diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2024-05-29 16:41:24 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2024-05-29 16:41:24 +0200 |
| commit | 9cf3c6313e77b0c3d80b8ffc298b20ab2d5b633d (patch) | |
| tree | 38e14e644432a8a3dd2d23634a7b65798731371d /tests | |
| parent | 3eb6d78ea9c2b67ca2bbcd4b775c70ab0558ab29 (diff) | |
Work on file resolve
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/references_test.odin | 41 |
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}, + }, + }, + }, + ) +} |