aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index d3a2eb7..7b42568 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -4698,3 +4698,43 @@ ast_completion_struct_field_value :: proc(t: ^testing.T) {
}
test.expect_completion_docs(t, &source, "", {"test.Foo: struct {}"})
}
+
+@(test)
+ast_completion_handle_matching_with_unary :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: struct{}
+
+ do_foo :: proc(foo: ^Foo){}
+
+ main :: proc() {
+ foo: Foo
+ do_foo(&f{*})
+ }
+ `,
+ config = {
+ enable_completion_matching = true,
+ },
+ }
+ test.expect_completion_insert_text(t, &source, "", {"foo"})
+}
+
+@(test)
+ast_completion_handle_matching_field_with_unary :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: struct{}
+
+ do_foo :: proc(foo: ^Foo){}
+
+ main :: proc() {
+ foo: Foo
+ do_foo(foo = &f{*})
+ }
+ `,
+ config = {
+ enable_completion_matching = true,
+ },
+ }
+ test.expect_completion_insert_text(t, &source, "", {"foo"})
+}