diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2021-05-01 22:55:10 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2021-05-01 22:55:10 +0200 |
| commit | 86c39dd5669b8aac89dd6237d98fcedd82d2a666 (patch) | |
| tree | fa59e29ace992f84c0c9bbe0b60ac56b920d34cc /src/testing | |
| parent | 8e07c7747d1714ddb4e235f247088c6030bd25ac (diff) | |
more tests + added default values in proc resolving
Diffstat (limited to 'src/testing')
| -rw-r--r-- | src/testing/testing.odin | 16 |
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); + } + } |