diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin index f4e9a7e..a9c1d0e 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -1009,7 +1009,7 @@ ast_implicit_named_comp_lit_bitset :: proc(t: ^testing.T) { } `, }; - + test.expect_completion_details(t, &source, ".", {"A", "B", "C"}); } @@ -1085,6 +1085,49 @@ ast_implicit_mixed_named_and_unnamed_comp_lit_bitset :: proc(t: ^testing.T) { test.expect_completion_details(t, &source, ".", {"A", "B", "C"}); } +@(test) +ast_inlined_struct :: proc(t: ^testing.T) { + source := test.Source { + main = `package main + import "my_package" + + My_Struct :: struct { + foo: struct { + a: int, + b: int, + }, + } + + main :: proc() { + inst: My_Struct + inst.foo.* + } + `, + }; + + test.expect_completion_details(t, &source, ".", {"struct.a: int", "struct.b: int"}); +} + +@(test) +ast_inlined_union :: proc(t: ^testing.T) { + source := test.Source { + main = `package main + import "my_package" + + My_Struct :: struct { + variant: union {int, f32}, + } + + main :: proc() { + inst: My_Struct + inst.* + } + `, + }; + + test.expect_completion_details(t, &source, ".", {"My_Struct.variant: union"}); +} + /* Looks like a bug in for each on w.* |