From 7283a70c8cdc3fcdeedc34e17a8025c15664464b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 11 May 2021 20:17:39 +0200 Subject: tests: rename misnamed testcases for consistency Signed-off-by: Jo-Philipp Wich --- .../03_bugs/22_compile_break_continue_scoping | 59 ---------------------- .../03_bugs/22_compiler_break_continue_scoping | 59 ++++++++++++++++++++++ .../03_bugs/22_compiler_parenthesized_division | 19 ------- .../03_bugs/23_compiler_parenthesized_division | 19 +++++++ 4 files changed, 78 insertions(+), 78 deletions(-) delete mode 100644 tests/custom/03_bugs/22_compile_break_continue_scoping create mode 100644 tests/custom/03_bugs/22_compiler_break_continue_scoping delete mode 100644 tests/custom/03_bugs/22_compiler_parenthesized_division create mode 100644 tests/custom/03_bugs/23_compiler_parenthesized_division (limited to 'tests/custom/03_bugs') diff --git a/tests/custom/03_bugs/22_compile_break_continue_scoping b/tests/custom/03_bugs/22_compile_break_continue_scoping deleted file mode 100644 index 461b144..0000000 --- a/tests/custom/03_bugs/22_compile_break_continue_scoping +++ /dev/null @@ -1,59 +0,0 @@ -When compiling a break or continue statement, the compiler emitted pop -instructions for local variables within the scope the break or continue -keyword appeared in, but it must also pop local variables in enclosing -scopes up until the scope of the containing loop or switch body. - --- Expect stdout -- -1 -2 -3 --- End -- - --- Testcase -- -{% - for (let i = 1; i <= 3; i++) { - while (true) { - let n = i; - - print(n, "\n"); - - { - // The `let n` stack slot is not popped since it is - // outside of break's scope... - break; - } - } - } -%} --- End -- - --- Expect stdout -- -1 -2 -3 -2 -4 -6 -3 -6 -9 --- End -- - --- Testcase -- -{% - for (let i = 1; i <= 3; i++) { - for (let j = 1; j <= 3; j++) { - let n = i * j; - - print(n, "\n"); - - if (j == 1) - { - // The `let n` stack slot is not popped since it is - // outside of continue's scope... - continue; - } - } - } -%} --- End -- diff --git a/tests/custom/03_bugs/22_compiler_break_continue_scoping b/tests/custom/03_bugs/22_compiler_break_continue_scoping new file mode 100644 index 0000000..461b144 --- /dev/null +++ b/tests/custom/03_bugs/22_compiler_break_continue_scoping @@ -0,0 +1,59 @@ +When compiling a break or continue statement, the compiler emitted pop +instructions for local variables within the scope the break or continue +keyword appeared in, but it must also pop local variables in enclosing +scopes up until the scope of the containing loop or switch body. + +-- Expect stdout -- +1 +2 +3 +-- End -- + +-- Testcase -- +{% + for (let i = 1; i <= 3; i++) { + while (true) { + let n = i; + + print(n, "\n"); + + { + // The `let n` stack slot is not popped since it is + // outside of break's scope... + break; + } + } + } +%} +-- End -- + +-- Expect stdout -- +1 +2 +3 +2 +4 +6 +3 +6 +9 +-- End -- + +-- Testcase -- +{% + for (let i = 1; i <= 3; i++) { + for (let j = 1; j <= 3; j++) { + let n = i * j; + + print(n, "\n"); + + if (j == 1) + { + // The `let n` stack slot is not popped since it is + // outside of continue's scope... + continue; + } + } + } +%} +-- End -- diff --git a/tests/custom/03_bugs/22_compiler_parenthesized_division b/tests/custom/03_bugs/22_compiler_parenthesized_division deleted file mode 100644 index a70703f..0000000 --- a/tests/custom/03_bugs/22_compiler_parenthesized_division +++ /dev/null @@ -1,19 +0,0 @@ -When compiling a parenthesized division or division-assignment expression, -the compiler didn't instruct the lexer to treat a potential subsequent -slash as operand, leading to an incorrect syntax error exception. - --- Expect stdout -- -0 -0 -0 -0 --- End -- - --- Testcase -- -{% - print(a / 1, "\n"); // this was okay - print(a /= 1, "\n"); // okay too - print((a / 1), "\n"); // this failed - print((a /= 1), "\n"); // failed as well -%} --- End -- diff --git a/tests/custom/03_bugs/23_compiler_parenthesized_division b/tests/custom/03_bugs/23_compiler_parenthesized_division new file mode 100644 index 0000000..a70703f --- /dev/null +++ b/tests/custom/03_bugs/23_compiler_parenthesized_division @@ -0,0 +1,19 @@ +When compiling a parenthesized division or division-assignment expression, +the compiler didn't instruct the lexer to treat a potential subsequent +slash as operand, leading to an incorrect syntax error exception. + +-- Expect stdout -- +0 +0 +0 +0 +-- End -- + +-- Testcase -- +{% + print(a / 1, "\n"); // this was okay + print(a /= 1, "\n"); // okay too + print((a / 1), "\n"); // this failed + print((a /= 1), "\n"); // failed as well +%} +-- End -- -- cgit v1.2.3