aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin46
1 files changed, 41 insertions, 5 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index 4403e02..1883032 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -5164,11 +5164,6 @@ ast_completion_empty_selector_with_ident_newline :: proc(t: ^testing.T) {
)
source := test.Source {
main = `package test
-
- Foo :: struct{
- x: int,
- }
-
import "my_package"
main :: proc() {
@@ -5180,3 +5175,44 @@ ast_completion_empty_selector_with_ident_newline :: proc(t: ^testing.T) {
}
test.expect_completion_docs(t, &source, "", {"my_package.Foo :: struct{}"})
}
+
+@(test)
+ast_completion_implicit_selector_binary_expr_proc_call :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package, context.temp_allocator)
+
+ append(
+ &packages,
+ test.Package {
+ pkg = "my_package",
+ source = `package my_package
+ Foo :: enum {
+ A,
+ B,
+ C,
+ }
+
+ Bar :: enum {
+ X,
+ Y,
+ }
+
+ foo :: proc(f: Foo) -> bit_set[Bar] {
+ return {.X}
+ }
+ `,
+ },
+ )
+ source := test.Source {
+ main = `package test
+ import "my_package"
+
+ main :: proc() {
+ results: bit_set[my_package.Bar]
+
+ results |= my_package.foo(.{*})
+ }
+ `,
+ packages = packages[:],
+ }
+ test.expect_completion_labels(t, &source, "", {"A", "B", "C"}, {"X", "Y"})
+}