diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2023-05-18 18:10:11 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2023-05-18 18:10:11 +0200 |
| commit | adfb252f6a0283a565fc5cd801baa1b8c7161d3d (patch) | |
| tree | 7c4808d78c459fcd8089c555f1e7b3f32cb9b330 /tests | |
| parent | 2b0dccaa496fd809e36e7d979995e843bca28bfb (diff) | |
Add support for gotos on comp literal fields
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/definition_test.odin | 82 |
1 files changed, 31 insertions, 51 deletions
diff --git a/tests/definition_test.odin b/tests/definition_test.odin index 250d2da..0f6c26f 100644 --- a/tests/definition_test.odin +++ b/tests/definition_test.odin @@ -7,75 +7,55 @@ import "shared:common" import test "shared:testing" -/* @(test) -ast_goto_untyped_value :: proc(t: ^testing.T) { +ast_goto_comp_lit_field :: proc(t: ^testing.T) { source := test.Source { - main = `package main - - xs := 2 - - main :: proc() { - xaa := xs - - - xaa* - } + main = `package test + Point :: struct { + x, y, z : f32, + } + + main :: proc() { + point := Point { + x{*} = 2, y = 5, z = 0, + } + } `, - packages = {}, - }; + } location := common.Location { range = { - start = { - line = 5, - character = 10, - }, - end = { - line = 5, - character = 12, - }, + start = {line = 2, character = 12}, + end = {line = 2, character = 13}, }, - uri = "file:///test/test.odin", } - test.expect_definition_locations(t, &source, {location}); + test.expect_definition_locations(t, &source, {location}) } -*/ -/* @(test) -ast_goto_local_procedure_ret_value :: proc(t: ^testing.T) { +ast_goto_comp_lit_field_indexed :: proc(t: ^testing.T) { source := test.Source { - main = `package main - my_function :: proc() -> int { - return 0; - } - - main :: proc() { - xaa := my_function() - - - xaa - } + main = `package test + Point :: struct { + x, y, z : f32, + } + + main :: proc() { + point := [2]Point { + {x{*} = 2, y = 5, z = 0}, + {y = 10, y = 20, z = 10}, + } + } `, - packages = {}, - }; + } location := common.Location { range = { - start = { - line = 5, - character = 10, - }, - end = { - line = 5, - character = 12, - }, + start = {line = 2, character = 12}, + end = {line = 2, character = 13}, }, - uri = "file:///test/test.odin", } - test.expect_definition_locations(t, &source, {location}); + test.expect_definition_locations(t, &source, {location}) } -*/ |