diff options
Diffstat (limited to 'tests/00_syntax')
-rw-r--r-- | tests/00_syntax/05_block_nesting | 7 | ||||
-rw-r--r-- | tests/00_syntax/13_object_literals | 1 | ||||
-rw-r--r-- | tests/00_syntax/16_for_loop | 23 | ||||
-rw-r--r-- | tests/00_syntax/17_while_loop | 2 | ||||
-rw-r--r-- | tests/00_syntax/19_arrow_functions | 6 | ||||
-rw-r--r-- | tests/00_syntax/21_regex_literals | 2 |
6 files changed, 26 insertions, 15 deletions
diff --git a/tests/00_syntax/05_block_nesting b/tests/00_syntax/05_block_nesting index 7b74adb..fcfd7da 100644 --- a/tests/00_syntax/05_block_nesting +++ b/tests/00_syntax/05_block_nesting @@ -8,6 +8,13 @@ In line 2, byte 61: Near here --------------------------------------------------^ +Syntax error: Template blocks may not be nested +In line 3, byte 61: + + `We may not nest expression blocks into statement blocks: {% {{ 1 + 2 }} %}.` + Near here --------------------------------------------------^ + + -- End -- -- Testcase -- diff --git a/tests/00_syntax/13_object_literals b/tests/00_syntax/13_object_literals index 60c9f32..67dbd6c 100644 --- a/tests/00_syntax/13_object_literals +++ b/tests/00_syntax/13_object_literals @@ -48,6 +48,7 @@ either JSON or JavaScript notation. print(another_obj, "\n"); print(third_obj, "\n"); print(nested_obj, "\n"); +%} -- End -- diff --git a/tests/00_syntax/16_for_loop b/tests/00_syntax/16_for_loop index 33d1d97..67edc21 100644 --- a/tests/00_syntax/16_for_loop +++ b/tests/00_syntax/16_for_loop @@ -218,11 +218,12 @@ Ensure that for-in loop expressions with more than two variables are rejected. -- Expect stderr -- -Syntax error: Invalid for-in expression -In line 2, byte 14: +Syntax error: Unexpected token +Expecting ';' +In line 2, byte 24: ` for (let x, y, z in {})` - Near here ------^ + Near here ----------------^ -- End -- @@ -238,11 +239,12 @@ In line 2, byte 14: Ensure that assignments in for-in loop expressions are rejected. -- Expect stderr -- -Syntax error: Invalid for-in expression -In line 2, byte 13: +Syntax error: Unexpected token +Expecting ';' +In line 2, byte 25: ` for (let x = 1, y in {})` - Near here -----^ + Near here -----------------^ -- End -- @@ -259,7 +261,7 @@ Ensure that too short for-in loop expressions are rejected (1/2). -- Expect stderr -- Syntax error: Unexpected token -Expecting ',' or 'in' +Expecting ';' In line 2, byte 12: ` for (let x)` @@ -279,11 +281,12 @@ In line 2, byte 12: Ensure that too short for-in loop expressions are rejected (2/2). -- Expect stderr -- -Syntax error: Invalid for-in expression -In line 2, byte 14: +Syntax error: Unexpected token +Expecting ';' +In line 2, byte 15: ` for (let x, y)` - Near here ------^ + Near here -------^ -- End -- diff --git a/tests/00_syntax/17_while_loop b/tests/00_syntax/17_while_loop index 4dfaccc..1e68d6b 100644 --- a/tests/00_syntax/17_while_loop +++ b/tests/00_syntax/17_while_loop @@ -32,7 +32,7 @@ Iteration 8 Iteration 9 A counting while-loop using the alternative syntax: -Iteration null +Iteration 0 Iteration 1 Iteration 2 Iteration 3 diff --git a/tests/00_syntax/19_arrow_functions b/tests/00_syntax/19_arrow_functions index 4847d8a..102c527 100644 --- a/tests/00_syntax/19_arrow_functions +++ b/tests/00_syntax/19_arrow_functions @@ -108,11 +108,11 @@ subsequent testcase asserts that case. -- Expect stderr -- Syntax error: Unexpected token -Expecting Label -In line 2, byte 5: +Expecting ';' +In line 2, byte 10: ` (a + 1) => { print("test\n") }` - ^-- Near here + Near here --^ -- End -- diff --git a/tests/00_syntax/21_regex_literals b/tests/00_syntax/21_regex_literals index 4aef33f..3af53bb 100644 --- a/tests/00_syntax/21_regex_literals +++ b/tests/00_syntax/21_regex_literals @@ -35,7 +35,7 @@ Testing invalid flag characters. -- Expect stderr -- Syntax error: Unexpected token -Expecting ',' or ';' +Expecting ';' In line 2, byte 8: ` /test/x` |