diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2021-04-27 22:21:04 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2021-04-27 22:21:04 +0200 |
| commit | fc742ab3b8fde5a70fa314c5ed2a1c94e503e877 (patch) | |
| tree | 57178511f76e9ddbaf7d2ee0fa9e846de6533a7d /tests | |
| parent | 07e8e34144d2c8929c8eb40779488464d77308bc (diff) | |
new tests
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 59 |
1 files changed, 54 insertions, 5 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 3b4ecc8..987f43f 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -7,7 +7,6 @@ import test "shared:testing" @(test)
ast_simple_struct_completion :: proc(t: ^testing.T) {
-
source := test.Source {
main = `package test
@@ -30,7 +29,6 @@ ast_simple_struct_completion :: proc(t: ^testing.T) { @(test)
ast_index_array_completion :: proc(t: ^testing.T) {
-
source := test.Source {
main = `package test
@@ -53,7 +51,6 @@ ast_index_array_completion :: proc(t: ^testing.T) { @(test)
ast_struct_pointer_completion :: proc(t: ^testing.T) {
-
source := test.Source {
main = `package test
@@ -76,7 +73,6 @@ ast_struct_pointer_completion :: proc(t: ^testing.T) { @(test)
ast_struct_take_address_completion :: proc(t: ^testing.T) {
-
source := test.Source {
main = `package test
@@ -100,7 +96,6 @@ ast_struct_take_address_completion :: proc(t: ^testing.T) { @(test)
ast_struct_deref_completion :: proc(t: ^testing.T) {
-
source := test.Source {
main = `package test
@@ -122,4 +117,58 @@ ast_struct_deref_completion :: proc(t: ^testing.T) { test.expect_completion_details(t, &source, ".", {"My_Struct.one: int", "My_Struct.two: int", "My_Struct.three: int"});
}
+@(test)
+ast_range_map :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+
+ My_Struct :: struct {
+ one: int,
+ two: int,
+ three: int,
+ }
+
+ main :: proc() {
+ my_map: map[int]My_Struct;
+
+ for key, value in my_map {
+ value.*
+ }
+
+ }
+ `,
+ source_packages = {},
+ };
+
+ test.expect_completion_details(t, &source, ".", {"My_Struct.one: int", "My_Struct.two: int", "My_Struct.three: int"});
+}
+
+@(test)
+ast_range_array :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+
+ My_Struct :: struct {
+ one: int,
+ two: int,
+ three: int,
+ }
+
+ main :: proc() {
+ my_array: []My_Struct;
+
+ for value in my_array {
+ value.*
+ }
+
+ }
+ `,
+ source_packages = {},
+ };
+
+ test.expect_completion_details(t, &source, ".", {"My_Struct.one: int", "My_Struct.two: int", "My_Struct.three: int"});
+}
+
+
+
|