aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-05-29 16:41:24 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-05-29 16:41:24 +0200
commit9cf3c6313e77b0c3d80b8ffc298b20ab2d5b633d (patch)
tree38e14e644432a8a3dd2d23634a7b65798731371d /tests
parent3eb6d78ea9c2b67ca2bbcd4b775c70ab0558ab29 (diff)
Work on file resolve
Diffstat (limited to 'tests')
-rw-r--r--tests/references_test.odin41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/references_test.odin b/tests/references_test.odin
index 25993ab..0989230 100644
--- a/tests/references_test.odin
+++ b/tests/references_test.odin
@@ -2,3 +2,44 @@ package tests
import "core:fmt"
import "core:testing"
+
+import test "src:testing"
+
+@(test)
+reference_variables_in_function :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ my_function :: proc() {
+ a := 2
+ b := a
+ c := 2 + b
+ }
+ `,
+ packages = {},
+ }
+
+ test.expect_symbol_location(
+ t,
+ &source,
+ {
+ {
+ range = {
+ start = {line = 2, character = 3},
+ end = {line = 2, character = 4},
+ },
+ },
+ {
+ range = {
+ start = {line = 3, character = 3},
+ end = {line = 3, character = 4},
+ },
+ },
+ {
+ range = {
+ start = {line = 4, character = 3},
+ end = {line = 4, character = 4},
+ },
+ },
+ },
+ )
+}