diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-03-04 20:15:37 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-03-04 20:15:37 +0100 |
| commit | bbfa8fbd84e3596d0756c57cb18971a8b37c187b (patch) | |
| tree | 37f2adbf02ab6c366f9009ea83b1ae3b2a0c3541 /tests | |
| parent | 4354356c7e3114347b21e9ad1e7d300d0a594e1c (diff) | |
add comma seperation on comp_lit string representation
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hover_test.odin | 41 | ||||
| -rw-r--r-- | tests/signatures_test.odin | 2 |
2 files changed, 31 insertions, 12 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin index c710fb7..3b6d153 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -18,7 +18,7 @@ ast_hover_default_intialized_parameter :: proc(t: ^testing.T) { packages = {}, }; - test.expect_hover(t, &source, "test.a: bool"); + test.expect_hover(t, &source, "test.a: bool") } @(test) @@ -33,9 +33,9 @@ ast_hover_default_parameter_enum :: proc(t: ^testing.T) { } `, packages = {}, - }; + } - test.expect_hover(t, &source, "test.procedure: proc(called_from: Expr_Called_Type = .None, options := List_Options{})"); + test.expect_hover(t, &source, "test.procedure: proc(called_from: Expr_Called_Type = .None, options := List_Options{})") } @(test) ast_hover_parameter :: proc(t: ^testing.T) { @@ -47,9 +47,9 @@ ast_hover_parameter :: proc(t: ^testing.T) { } `, packages = {}, - }; + } - test.expect_hover(t, &source, "cool: int"); + test.expect_hover(t, &source, "cool: int") } @(test) @@ -65,7 +65,7 @@ ast_hover_external_package_parameter :: proc(t: ^testing.T) { three: int, } `, - }); + }) source := test.Source { main = `package test import "my_package" @@ -74,9 +74,9 @@ ast_hover_external_package_parameter :: proc(t: ^testing.T) { } `, packages = packages[:], - }; + } - test.expect_hover(t, &source, "test.cool: My_Struct"); + test.expect_hover(t, &source, "test.cool: My_Struct") } @(test) @@ -92,7 +92,7 @@ ast_hover_procedure_package_parameter :: proc(t: ^testing.T) { three: int, } `, - }); + }) source := test.Source { main = `package test import "my_package" @@ -101,7 +101,26 @@ ast_hover_procedure_package_parameter :: proc(t: ^testing.T) { } `, packages = packages[:], - }; + } + + test.expect_hover(t, &source, "my_package: package") +} + +@(test) +ast_hover_procedure_with_default_comp_lit :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + Color :: struct { + r: int, + g: int, + b: int, + a: int, + } + + fa* :: proc(color_ : Color = { 255, 255, 255, 255 }) + + `, + } - test.expect_hover(t, &source, "my_package: package"); + test.expect_hover(t, &source, "test.fa: proc(color_: Color = {255, 255, 255, 255})") } diff --git a/tests/signatures_test.odin b/tests/signatures_test.odin index acc8271..1bb44d5 100644 --- a/tests/signatures_test.odin +++ b/tests/signatures_test.odin @@ -358,7 +358,7 @@ ast_index_builtin_len_proc :: proc(t: ^testing.T) { packages = {}, }; - test.expect_signature_labels(t, &source, {"builtin.len: proc(array: Array_Type) -> int"}); + test.expect_signature_labels(t, &source, {"$builtin.len: proc(array: Array_Type) -> int"}); } @(test) |