aboutsummaryrefslogtreecommitdiff
path: root/tests/completions_test.odin
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2022-03-14 21:41:04 +0100
committerDaniel Gavin <danielgavin5@hotmail.com>2022-03-14 21:41:04 +0100
commit123783da820cfa5cd2b230dd910e07005f30ebca (patch)
tree487c2d24647bec8f48328f9bb9eeb9ca4149af2c /tests/completions_test.odin
parent06562b8ff7d3d4ad3bb22b66eef8c8111fe243da (diff)
Fix union completion with pointers.
Diffstat (limited to 'tests/completions_test.odin')
-rw-r--r--tests/completions_test.odin31
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)