aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-06-11 19:42:43 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-06-11 19:42:43 +0200
commitb88ec3cd61dddb43f2434e270835ba341ba31b3f (patch)
tree12db4493c247c8008eb2b0aa4c37ad280e3a60e0 /tests
parentf14f7ee50ba4b47f7a23e47fe61657b36f3014be (diff)
Adding support to the union enums
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index d74de1b..ea7a8ab 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -2665,6 +2665,33 @@ ast_simple_bit_field_completion :: proc(t: ^testing.T) {
)
}
+@(test)
+ast_simple_union_of_enums_completion :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Sub_Enum_1 :: enum {
+ ONE,
+ }
+ Sub_Enum_2 :: enum {
+ TWO,
+ }
+
+ Super_Enum :: union {
+ Sub_Enum_1,
+ Sub_Enum_2,
+ }
+
+ fn :: proc(mode: Super_Enum) {}
+
+ main :: proc() {
+ fn(.{*})
+ }
+ `,
+ }
+
+ test.expect_completion_labels(t, &source, ".", {"ONE", "TWO"})
+}
+
@(test)
ast_generics_function_with_struct_same_pkg :: proc(t: ^testing.T) {