diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2024-06-11 19:42:43 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2024-06-11 19:42:43 +0200 |
| commit | b88ec3cd61dddb43f2434e270835ba341ba31b3f (patch) | |
| tree | 12db4493c247c8008eb2b0aa4c37ad280e3a60e0 /tests | |
| parent | f14f7ee50ba4b47f7a23e47fe61657b36f3014be (diff) | |
Adding support to the union enums
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 27 |
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) { |