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 /tests | |
| parent | 8e07c7747d1714ddb4e235f247088c6030bd25ac (diff) | |
more tests + added default values in proc resolving
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 37 | ||||
| -rw-r--r-- | tests/hover_test.odin | 16 |
2 files changed, 53 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin index a247dc2..b6fad88 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -246,3 +246,40 @@ ast_completion_range_struct_selector_strings :: proc(t: ^testing.T) { test.expect_completion_details(t, &source, "", {"test.value: string"}); } +@(test) +ast_completion_selector_on_indexed_array :: proc(t: ^testing.T) { + + source := test.Source { + main = `package test + + My_Foo :: struct { + a: int, + b: int, + } + + My_Struct :: struct { + array: []My_Foo, + } + + main :: proc() { + my_struct: My_Struct; + + my_struct.array[len(my_struct.array)-1].* + } + `, + source_packages = {}, + }; + + test.expect_completion_details(t, &source, ".", {"My_Foo.a: int", "My_Foo.b: int"}); +} + + +/* + + SymbolUntypedValue :: struct { + type: enum {Integer, Float, String, Bool}, + } + + Can't complete nested enums(maybe structs also?) + +*/
\ No newline at end of file diff --git a/tests/hover_test.odin b/tests/hover_test.odin index e0cf98f..5daa3e2 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -5,3 +5,19 @@ import "core:fmt" import test "shared:testing" +@(test) +ast_hover_default_intialized_parameter :: proc(t: ^testing.T) { + + source := test.Source { + main = `package test + + my_function :: proc(a := false) { + b := a*; + } + + `, + source_packages = {}, + }; + + test.expect_hover(t, &source, "test.a: bool"); +}
\ No newline at end of file |