From 123783da820cfa5cd2b230dd910e07005f30ebca Mon Sep 17 00:00:00 2001 From: Daniel Gavin Date: Mon, 14 Mar 2022 21:41:04 +0100 Subject: Fix union completion with pointers. --- tests/completions_test.odin | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'tests') 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,11 +1063,36 @@ 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 { @@ -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) -- cgit v1.2.3