Skip to content

Commit df6a85e

Browse files
committed
feat: Add new test fixture for failing multiline errors and remove old fixture
1 parent fe6e421 commit df6a85e

File tree

4 files changed

+85
-9
lines changed

4 files changed

+85
-9
lines changed

internal/test_helpers/fixtures/fail_scanning_errors_1

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[stage-11] Running tests for Stage #11: tz7
2+
[stage-11] [test-1] Running test case: 1
3+
[stage-11] [test-1] Writing contents to ./test.lox:
4+
[stage-11] [test-1] [test.lox] ()<|SPACE|><|TAB|>@
5+
[stage-11] [test-1] $ ./your_program.sh tokenize test.lox
6+
[your_program] [line 2] Error: Unexpected character: @
7+
[your_program] LEFT_PAREN ( null
8+
[your_program] RIGHT_PAREN ) null
9+
[your_program] EOF null
10+
[stage-11] [test-1] ✓ 1 line(s) match on stderr
11+
[stage-11] [test-1] ✓ 3 line(s) match on stdout
12+
[stage-11] [test-1] ✓ Received exit code 65.
13+
[stage-11] [test-2] Running test case: 2
14+
[stage-11] [test-2] Writing contents to ./test.lox:
15+
[stage-11] [test-2] [test.lox] @#
16+
[stage-11] [test-2] [test.lox] <|SPACE|>
17+
[stage-11] [test-2] $ ./your_program.sh tokenize test.lox
18+
[your_program] EOF null
19+
[your_program] [line 1] Error: Unexpected character: @
20+
[stage-11] [test-2] ✓ [line 1] Error: Unexpected character: @
21+
[stage-11] [test-2] 
22+
[stage-11] [test-2] [stderr] Missing line #2 from stderr: "[line 1] Error: Unexpected character: #"
23+
[stage-11] [test-2] [stderr] Perhaps it's printed to stdout? It should be printed to stderr.
24+
[stage-11] [test-2]  
25+
[stage-11] [test-2] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[stage-11] Running tests for Stage #11: tz7
2+
[stage-11] [test-1] Running test case: 1
3+
[stage-11] [test-1] Writing contents to ./test.lox:
4+
[stage-11] [test-1] [test.lox] ()<|SPACE|><|TAB|>@
5+
[stage-11] [test-1] $ ./your_program.sh tokenize test.lox
6+
[your_program] LEFT_PAREN ( null
7+
[your_program] RIGHT_PAREN ) null
8+
[your_program] EOF null
9+
[your_program] This line will be skipped in stderr
10+
[your_program] [line 2] Error: Unexpected character: @
11+
[stage-11] [test-1] ✓ 1 line(s) match on stderr
12+
[stage-11] [test-1] ✓ 3 line(s) match on stdout
13+
[stage-11] [test-1] ✓ Received exit code 65.
14+
[stage-11] [test-2] Running test case: 2
15+
[stage-11] [test-2] Writing contents to ./test.lox:
16+
[stage-11] [test-2] [test.lox] @#
17+
[stage-11] [test-2] [test.lox] <|SPACE|>
18+
[stage-11] [test-2] $ ./your_program.sh tokenize test.lox
19+
[your_program] EOF null
20+
[your_program] This line will be skipped in stderr
21+
[your_program] [line 1] Error: Unexpected character: @
22+
[your_program] This line will be skipped in stderr
23+
[your_program] [line 1] eRrRr: Unexpected character: #
24+
[stage-11] [test-2] ✓ [line 1] Error: Unexpected character: @
25+
[stage-11] [test-2] 
26+
[stage-11] [test-2] [stderr] Mismatch on line #2 of stderr:
27+
[stage-11] [test-2] [stderr] Expected: "[line 1] Error: Unexpected character: #"
28+
[stage-11] [test-2] [stderr] Actual : "[line 1] eRrRr: Unexpected character: #"
29+
[stage-11] [test-2]  
30+
[stage-11] [test-2] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[stage-11] Running tests for Stage #11: tz7
2+
[stage-11] [test-1] Running test case: 1
3+
[stage-11] [test-1] Writing contents to ./test.lox:
4+
[stage-11] [test-1] [test.lox] ()<|SPACE|><|TAB|>@
5+
[stage-11] [test-1] $ ./your_program.sh tokenize test.lox
6+
[your_program] LEFT_PAREN ( null
7+
[your_program] This line will be skipped in stderr
8+
[your_program] [line 2] Error: Unexpected character: @
9+
[your_program] RIGHT_PAREN ) null
10+
[your_program] EOF null
11+
[stage-11] [test-1] ✓ 1 line(s) match on stderr
12+
[stage-11] [test-1] ✓ 3 line(s) match on stdout
13+
[stage-11] [test-1] ✓ Received exit code 65.
14+
[stage-11] [test-2] Running test case: 2
15+
[stage-11] [test-2] Writing contents to ./test.lox:
16+
[stage-11] [test-2] [test.lox] @#
17+
[stage-11] [test-2] [test.lox] <|SPACE|>
18+
[stage-11] [test-2] $ ./your_program.sh tokenize test.lox
19+
[your_program] This line will be skipped in stderr
20+
[your_program] EOF null
21+
[your_program] [line 1] Error: Unexpected character: @
22+
[your_program] This line will be skipped in stderr
23+
[your_program] [line 1] Error: Unexpected character: #
24+
[your_program] [line 888] extra line
25+
[stage-11] [test-2] ✓ [line 1] Error: Unexpected character: @
26+
[stage-11] [test-2] ✓ [line 1] Error: Unexpected character: #
27+
[stage-11] [test-2] 
28+
[stage-11] [test-2] 𐄂 [stderr] Extra unexpected line in stderr: "[line 888] extra line"
29+
[stage-11] [test-2]  
30+
[stage-11] [test-2] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)

0 commit comments

Comments
 (0)