aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.odin
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2021-05-01 22:55:10 +0200
committerDaniel Gavin <danielgavin5@hotmail.com>2021-05-01 22:55:10 +0200
commit86c39dd5669b8aac89dd6237d98fcedd82d2a666 (patch)
treefa59e29ace992f84c0c9bbe0b60ac56b920d34cc /src/testing/testing.odin
parent8e07c7747d1714ddb4e235f247088c6030bd25ac (diff)
more tests + added default values in proc resolving
Diffstat (limited to 'src/testing/testing.odin')
-rw-r--r--src/testing/testing.odin16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/testing/testing.odin b/src/testing/testing.odin
index 001b8cf..5bb8d63 100644
--- a/src/testing/testing.odin
+++ b/src/testing/testing.odin
@@ -134,7 +134,21 @@ expect_completion_details :: proc(t: ^testing.T, src: ^Source, trigger_character
}
-expect_hover :: proc(t: ^testing.T, src: ^Source, expect_hover_info: string) {
+expect_hover :: proc(t: ^testing.T, src: ^Source, expect_hover_string: string) {
setup(src);
+ hover, ok := server.get_hover_information(src.document, src.position);
+
+ if !ok {
+ testing.error(t, "Failed get_hover_information");
+ }
+
+ if expect_hover_string == "" && hover.contents.value != "" {
+ testing.errorf(t, "Expected empty hover string, but received %v", hover.contents.value);
+ }
+
+ if strings.contains(expect_hover_string, hover.contents.value) {
+ testing.errorf(t, "Expected hover string %v, but received %v", expect_hover_string, hover.contents.value);
+ }
+
}