aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin@Daniels-MacBook-Air.local>2023-06-18 12:39:21 +0200
committerDaniel Gavin <danielgavin@Daniels-MacBook-Air.local>2023-06-18 12:39:21 +0200
commitaa191c9a55cec48025dbc125be4bd51d5a7545b0 (patch)
treedaa71f05aab10d92a81588b4922a9fc8b60fa527 /tests
parentb36ed688de204602303f40bab29359d3e984c9ed (diff)
Make sure that sliced expressions return slices.
Diffstat (limited to 'tests')
-rw-r--r--tests/hover_test.odin14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 910f0be..a21ca70 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -156,3 +156,17 @@ ast_hover_same_name_in_selector_and_field :: proc(t: ^testing.T) {
test.expect_hover(t, &source, "Color.color: int")
}
+
+@(test)
+zzast_hover_on_sliced_result :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ f :: proc() {
+ buf: [420]byte
+ slic{*}e := buf[2:20]
+ }
+ `,
+ }
+
+ test.expect_hover(t, &source, "test.slice: []byte")
+}