diff options
| author | Bradley Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-11 16:16:48 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-11 16:16:48 -0400 |
| commit | 55acd3fe129551dd0ce231390f8d07a446754efe (patch) | |
| tree | 3529baa929ad360af1922f786843160f1287065d /tests | |
| parent | fa321af72d7b8c5614a5d9745b56e9df119f5842 (diff) | |
| parent | 3bc8007c8135a9f47842bb100f1527793ef678f3 (diff) | |
Merge pull request #853 from BradLewis/fix/resolve-bit-set-union-intersection
Correctly resolve bit_set union and intersections with comp lits
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hover_test.odin | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin index 684d457..916a247 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -3662,6 +3662,42 @@ ast_hover_union_with_align :: proc(t: ^testing.T) { "test.Foo: union #no_nil #align(4) {\n\tint,\n\tstring,\n}" ) } + +@(test) +ast_hover_bit_set_intersection :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + Flag :: enum u8 {Foo, Bar} + Flags :: distinct bit_set[Flag; u8] + + foo_bar := Flags{.Foo, .Bar} // foo_bar: bit_set[Flag] + foo_{*}b := foo_bar & {.Foo} // hover for foo_b + `, + } + test.expect_hover( + t, + &source, + "test.foo_b: bit_set[Flag]\n// hover for foo_b" + ) +} + +@(test) +ast_hover_bit_set_union :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + Flag :: enum u8 {Foo, Bar} + Flags :: distinct bit_set[Flag; u8] + + foo_bar := Flags{.Bar} // foo_bar: bit_set[Flag] + foo_{*}b := {.Foo} | foo_bar // hover for foo_b + `, + } + test.expect_hover( + t, + &source, + "test.foo_b: bit_set[Flag]\n// hover for foo_b" + ) +} /* Waiting for odin fix |