diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-03-14 21:41:04 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-03-14 21:41:04 +0100 |
| commit | 123783da820cfa5cd2b230dd910e07005f30ebca (patch) | |
| tree | 487c2d24647bec8f48328f9bb9eeb9ca4149af2c /tests/completions_test.odin | |
| parent | 06562b8ff7d3d4ad3bb22b66eef8c8111fe243da (diff) | |
Fix union completion with pointers.
Diffstat (limited to 'tests/completions_test.odin')
| -rw-r--r-- | tests/completions_test.odin | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 3655b42..70fc965 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -1063,12 +1063,37 @@ ast_implicit_mixed_named_and_unnamed_comp_lit_bitset :: proc(t: ^testing.T) { } } `, - }; + } test.expect_completion_details(t, &source, ".", {"A", "B", "C"}); } @(test) +ast_comp_lit_in_complit_completion :: proc(t: ^testing.T) { + source := test.Source { + main = `package main + My_Struct_2 :: struct { + aaa: int, + aab: int, + } + My_Struct :: struct { + foo: My_Struct_2, + } + + main :: proc() { + inst := My_Struct { + foo = { + a* + } + } + } + `, + } + + test.expect_completion_details(t, &source, "", {"My_Struct_2.aab: int", "My_Struct_2.aaa: int"}) +} + +@(test) ast_inlined_struct :: proc(t: ^testing.T) { source := test.Source { main = `package main @@ -1084,9 +1109,9 @@ ast_inlined_struct :: proc(t: ^testing.T) { inst.foo.* } `, - }; + } - test.expect_completion_details(t, &source, ".", {"struct.a: int", "struct.b: int"}); + test.expect_completion_details(t, &source, ".", {"struct.a: int", "struct.b: int"}) } @(test) |