diff options
| author | Bradley Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-10-30 17:11:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-30 17:11:14 -0400 |
| commit | af3a10a0e3030e8360607982d22781b59bcb6cb9 (patch) | |
| tree | e04d5112f06abf9f4f7a83436b8c10f92911ad8f /tests | |
| parent | 4fc217ef397898d8251ad8391895f2da22cbb848 (diff) | |
| parent | 847d511c4c132ca773d6f29c705a0ad12823af63 (diff) | |
Merge pull request #1139 from BradLewis/fix/resolve-local-whens
Correctly resolve local when blocks
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 628107a..ce30589 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -4889,3 +4889,39 @@ ast_completion_cast_rawptr_selector :: proc(t: ^testing.T) { } test.expect_completion_docs(t, &source, "", {"Foo.bar: bool"}) } + +@(test) +ast_completion_local_when_condition :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + + main :: proc() { + when true { + foo : i32 = 5 + } else { + foo : i64 = 6 + } + fo{*} + } + `, + } + test.expect_completion_docs(t, &source, "", {"test.foo: i32"}) +} + +@(test) +ast_completion_local_when_condition_false :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + + main :: proc() { + when false { + foo : i32 = 5 + } else { + foo : i64 = 6 + } + fo{*} + } + `, + } + test.expect_completion_docs(t, &source, "", {"test.foo: i64"}) +} |