diff options
Diffstat (limited to 'tests/hover_test.odin')
| -rw-r--r-- | tests/hover_test.odin | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin index 06d3dce..81c732a 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -5716,6 +5716,60 @@ ast_hover_bitshift_integer_type :: proc(t: ^testing.T) { } test.expect_hover(t, &source, "test.bar: int") } + +@(test) +ast_hover_type_assertion_unary_value :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + Foo :: union { + int, + f64, + } + + main :: proc() { + foo := Foo(0.0) + i{*} := &foo.(int) + } + `, + } + test.expect_hover(t, &source, "test.i: ^int") +} + +@(test) +ast_hover_type_assertion_unary_value_value :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + Foo :: union { + int, + f64, + } + + main :: proc() { + foo := Foo(0.0) + i{*}, ok := &foo.(int) + } + `, + } + test.expect_hover(t, &source, "test.i: ^int") +} + +@(test) +ast_hover_type_assertion_unary_value_ok :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + Foo :: union { + int, + f64, + } + + main :: proc() { + foo := Foo(0.0) + i, ok{*} := &foo.(int) + } + `, + } + test.expect_hover(t, &source, "test.ok: bool") +} /* Waiting for odin fix |