# \#TZ7 expects wrong output?

**URL:** <https://forum.codecrafters.io/t/tz7-expects-wrong-output/3975>\
**Category:** Bug Reports\
**Tags:** challenge:interpreter\
**Created:** [January 5, 2025, 3:29pm UTC](https://forum.codecrafters.io/t/tz7-expects-wrong-output/3975 "2025-01-05T15:29:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stef16Robbe](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/stef16robbe/32/374_2.png) [@Stef16Robbe](https://forum.codecrafters.io/u/Stef16Robbe)\
**Post date:** [January 5, 2025, 3:29pm UTC](https://forum.codecrafters.io/t/tz7-expects-wrong-output/3975/1 "2025-01-05T15:29:03Z")

</div>

I’m stuck on Stage #TZ7.

I’ve implemented the error line correctly as far as I’m aware, but I don’t understand the first test.

Here are my logs:

```auto
~/proj/personal/codecrafters-interpreter-rust> codecrafters test
Initiating test run...

⚡ This is a turbo test run. https://codecrafters.io/turbo

Running tests. Logs should appear shortly...

[compile] Compiling codecrafters-interpreter v0.1.0 (/app)
[compile] Finished `release` profile [optimized] target(s) in 1.82s
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.

[tester::#TZ7] Running tests for Stage #TZ7 (Scanning: Multi-line errors)
[tester::#TZ7] [test-1] Running test case: 1
[tester::#TZ7] [test-1] Writing contents to ./test.lox:
[tester::#TZ7] [test-1] [test.lox] ()<|SPACE|><|TAB|>@
[tester::#TZ7] [test-1] $ ./your_program.sh tokenize test.lox
[your_program] LEFT_PAREN ( null
[your_program] RIGHT_PAREN ) null
[your_program] EOF null
[your_program] [line 1] Error: Unexpected character: @
[tester::#TZ7] [test-1] 𐄂 [line 1] Error: Unexpected character: @
[tester::#TZ7] [test-1] Expected line #1 on stderr to be "[line 2] Error: Unexpected character: @", got "[line 1] Error: Unexpected character: @"
[tester::#TZ7] [test-1] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)

View our article on debugging test failures: https://codecrafters.io/debug

```

So the question is, why does the test expect the error to be on line #2 whilst there are no newlines in the input? there’s only a tab and a space, why should the @ be on line 2?

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [January 5, 2025, 11:46pm UTC](https://forum.codecrafters.io/t/tz7-expects-wrong-output/3975/3 "2025-01-05T23:46:26Z")

</div>

Hi @Stef16Robbe, there is actually a newline present in the test case:

> <https://github.com/codecrafters-io/interpreter-tester/blob/73622a1f0f14f4885c4f7c9f3f6c39e4d51bfb6e/internal/stage11.go#L19-L20>

That said, we’ll work on fixing the display issue and keep you updated on any changes.

---

<div class="post-metadata">

**Author:** ![Stef16Robbe](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/stef16robbe/32/374_2.png) [@Stef16Robbe](https://forum.codecrafters.io/u/Stef16Robbe)\
**Post date:** [January 6, 2025, 7:55am UTC](https://forum.codecrafters.io/t/tz7-expects-wrong-output/3975/4 "2025-01-06T07:55:43Z")

</div>

Thanks andy, I can’t believe my code was wrong! 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [January 15, 2025, 11:11am UTC](https://forum.codecrafters.io/t/tz7-expects-wrong-output/3975/6 "2025-01-15T11:11:20Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
