Stage #UN3 problem

I’m stuck on Stage #(UN3).

My tests pass in terms of current stage, but it fails on Redirection - Append stderr.
It doesn’t looks it should.

I test locally and everything works expected. I can’t understand the reason of fail.

Here are my logs:

[tester::#QP2] Running tests for Stage #QP2 (Autocompletion - Builtin completion)
[tester::#QP2] Running ./your_program.sh
[tester::#QP2] ✓ Received prompt ($ )
[tester::#QP2] Typed "ech"
[tester::#QP2] ✓ Prompt line matches "$ ech"
[tester::#QP2] Pressed "<TAB>" (expecting autocomplete to "echo")
[tester::#QP2] ✓ Prompt line matches "echo"
[your-program] $ echo
[tester::#QP2] Tearing down shell
[tester::#QP2] Running ./your_program.sh
[tester::#QP2] ✓ Received prompt ($ )
[tester::#QP2] Typed "exi"
[tester::#QP2] ✓ Prompt line matches "$ exi"
[tester::#QP2] Pressed "<TAB>" (expecting autocomplete to "exit")
[tester::#QP2] ✓ Prompt line matches "exit"
[your-program] $ exit
[tester::#QP2] Tearing down shell
[tester::#QP2] Test passed.

[tester::#UN3] Running tests for Stage #UN3 (Redirection - Append stderr)
[tester::#UN3] [setup] export PATH=/tmp/pineapple/strawberry/apple:$PATH
[tester::#UN3] Running ./your_program.sh
[your-program] $ ls -1 nonexistent >> /tmp/ant/ant.md
[tester::#UN3] Didn't find expected line.
[tester::#UN3] Expected: "ls: nonexistent: No such file or directory"
[tester::#UN3] Received: "" (no line received)
[tester::#UN3] Assertion failed.
[tester::#UN3] Test failed

And here’s a snippet of my code:

https://git.codecrafters.io/[edited by Andy, because other people can push to your repo]

I can’t open the above link.

How are you forwarding stderr from the the process launch back to your shell?

Hey @krishnarathnam, looks like the latest code has broken earlier stages. Specifically, redraw clears a line before updating it, and the tester can capture the screen in that intermediate state.

You can verify that earlier stages are broken by using the CLI to test against previous stages:

codecrafters test --previous

Let me know if you’d like any further clarification!

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