aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2022-10-25 16:32:06 +0200
committerDaniel Gavin <danielgavin5@hotmail.com>2022-10-25 16:32:06 +0200
commit6ec6afac04b470ff7fa6b668bdab290af56297af (patch)
treebd45a96516c27bd0c2311c4a7327b1306d1399d1 /tests
parentba3eaa84a7e843aadd66bdf336ecae550c43f34a (diff)
Fix issue with union having a type from a different package.
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 930ede3..14f8800 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -1895,3 +1895,36 @@ ast_switch_completion_for_maybe_enum :: proc(t: ^testing.T) {
test.expect_completion_details(t, &source, ".", {"One", "Two"})
}
+
+ast_union_with_type_from_different_package :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package)
+
+ append(
+ &packages,
+ test.Package{
+ pkg = "my_package",
+ source = `package my_package
+ My_Int :: int
+ `,
+ },
+ )
+
+ source := test.Source {
+ main = `package main
+ import "my_package"
+
+ My_Union :: union {
+ bool,
+ my_package.My_Int,
+ }
+
+ main :: proc() {
+ my_union: My_Union
+ my_union.*
+ }
+ `,
+ packages = packages[:],
+ }
+
+ test.expect_completion_labels(t, &source, ".", {"(my_package.My_Int)"})
+}