aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-21 09:08:31 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-21 09:08:31 -0400
commitee22998e6e8beec8e3926c9c6b1a0dbd99b3d6db (patch)
tree6c894a1f39ec66c631d67b4f8519e620c06638bd /tests
parent5bdd01db885abb3df58a2ed9501f418fc58e7ee8 (diff)
Improve hover for global constant variables
Diffstat (limited to 'tests')
-rw-r--r--tests/hover_test.odin18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 9f41c2c..bed597c 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -2895,7 +2895,7 @@ ast_hover_builtin_max_with_type_global :: proc(t: ^testing.T) {
ma{*}x_u32 :: max(u32)
`,
}
- test.expect_hover(t, &source, "test.max_u32 :: u32")
+ test.expect_hover(t, &source, "test.max_u32 :: max(u32)")
}
@(test)
@@ -2905,7 +2905,7 @@ ast_hover_builtin_max_ints :: proc(t: ^testing.T) {
ma{*}x_int :: max(1, 2, 3, 4)
`,
}
- test.expect_hover(t, &source, "test.max_int :: 4")
+ test.expect_hover(t, &source, "test.max_int :: max(1, 2, 3, 4)")
}
@(test)
@@ -2941,7 +2941,7 @@ ast_hover_builtin_max_mix_global_const :: proc(t: ^testing.T) {
m{*} :: max(1, 2.0, 3, 4.6)
`,
}
- test.expect_hover(t, &source, "test.m :: 4.6")
+ test.expect_hover(t, &source, "test.m :: max(1, 2.0, 3, 4.6)")
}
@(test)
@@ -4247,7 +4247,7 @@ ast_hover_binary_expr_with_type :: proc(t: ^testing.T) {
F{*}OO :: 1 + u8(2)
`,
}
- test.expect_hover(t, &source, "test.FOO :: u8")
+ test.expect_hover(t, &source, "test.FOO :: 1 + u8(2)")
}
@(test)
@@ -4914,6 +4914,16 @@ ast_hover_const_comp_lit_with_type :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.FOO : Foo : {\n\ta = 1,\n\tb = \"b\",\n}")
}
+
+@(test)
+ast_hover_const_binary_expr :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ F{*}OO :: 3 + 4
+ `,
+ }
+ test.expect_hover(t, &source, "test.FOO :: 3 + 4")
+}
/*
Waiting for odin fix