aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2022-10-02 17:27:24 +0200
committerDaniel Gavin <danielgavin5@hotmail.com>2022-10-02 17:27:24 +0200
commitfcb535b92278c22596441d9a881c4f1cd4c7fc95 (patch)
tree1856c3ffef4da8b0142d1216527aee556d6ffb20 /tests
parent8f6b082e67784c693d51ce8f9013cfff7ca643f6 (diff)
Fix signature print issue, and switch stmt in a switch type stmt.
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin35
1 files changed, 31 insertions, 4 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index a63c32c..930ede3 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -1857,10 +1857,11 @@ ast_procedure_in_procedure_non_mutable_completion :: proc(t: ^testing.T) {
source := test.Source {
main = `package test
test :: proc() {
- Int :: int
-
- my_procedure_two :: proc() {
- b : In*
+ Int :: int
+
+ my_procedure_two :: proc() {
+ b : In*
+ }
}
`,
packages = {},
@@ -1868,3 +1869,29 @@ ast_procedure_in_procedure_non_mutable_completion :: proc(t: ^testing.T) {
test.expect_completion_details(t, &source, "", {"Int"})
}
+
+@(test)
+ast_switch_completion_for_maybe_enum :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Maybe :: union($T: typeid) {T}
+
+ My_Enum :: enum {
+ One,
+ Two,
+ }
+ main :: proc(a: Maybe(My_Enum)) {
+ switch v in a {
+ case My_Enum:
+ switch v {
+ case .*
+ }
+
+ }
+ }
+ `,
+ packages = {},
+ }
+
+ test.expect_completion_details(t, &source, ".", {"One", "Two"})
+}