aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2023-07-28 19:30:15 +0200
committerDanielGavin <danielgavin5@hotmail.com>2023-07-28 19:30:15 +0200
commitb994162b8a04175f5aae94fd59ce46f388c1f179 (patch)
tree234c4dde675838eea6b94d7b46eaf15b67f3e1cf /tests
parentcff67bad212b231dde04b8a1abb84c0c4a50290a (diff)
Fix more issues with bitset inference
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index 65078f9..3078a14 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -2298,3 +2298,36 @@ ast_private_proc_ignore :: proc(t: ^testing.T) {
test.expect_completion_labels(t, &source, ".", {})
}
+
+@(test)
+ast_bitset_assignment_diff_pkg :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package)
+
+ append(
+ &packages,
+ test.Package{
+ pkg = "my_package",
+ source = `package my_package
+ Foo :: enum { Aa, Ab, Ac, Ad }
+ Foo_Set :: bit_set[Foo]
+ `,
+ },
+ )
+
+ source := test.Source {
+ main = `package main
+ import "my_package"
+
+ Bar :: struct {
+ set: my_package.Foo_Set,
+ }
+ main :: proc() {
+ s: Bar
+ s.set = {.{*}}
+ }
+ `,
+ packages = packages[:],
+ }
+
+ test.expect_completion_labels(t, &source, ".", {"Aa", "Ab", "Ac", "Ad"})
+}