aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-10-03 21:09:40 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-10-03 21:09:40 +0200
commit4b8678b8f6b54e3c8dbbbd943228e6b9c919f330 (patch)
tree2ff883720f8a12ebc92f3b55519b9074be839e33 /tests
parent28982c543bf43eb3378cc47b7aa33c405f7bc6b2 (diff)
Make sure variables aren't spilled in case clauses
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index cac4285..b695732 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -2955,3 +2955,21 @@ ast_raw_data_slice_2 :: proc(t: ^testing.T) {
test.expect_completion_details(t, &source, "", {"test.rezz: [^]int"})
}
+
+@(test)
+ast_switch_completion_multiple_cases :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package main
+ main :: proc() {
+ switch {
+ case true:
+ foozz: int
+ case false:
+ fooz{*}
+ }
+ }
+ `,
+ }
+
+ test.expect_completion_details(t, &source, "", {})
+}