#QP2 submission failing because of a #UN3 failure

When I submitted my solution for stage #QP2, it passed the tests for the target stage, but failed for stage #UN3 (a stage from previous section). My code already passed that stage, so I am trying to understand why its failing the test now.

[tester::#QP2] Running tests for Stage #QP2 (Command Completion - 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" followed by a space)
[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" followed by a space)
[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/strawberry/strawberry/banana:$PATH
[tester::#UN3] Running ./your_program.sh
[your-program] $ ls -1 nonexistent >> /tmp/pig/bee.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] Test failed

The test is using >>, but I think it should have used 2>> instead. Please let me know in case I am wrong here.

Hey @aniketpt, could you upload your code to GitHub and share the link? It will be much easier to debug if I can run it directly.

Sure, please check here - GitHub - aniketpt/codecrafters-shell-go ยท GitHub

@aniketpt Looks like your code is no longer passing the second stage #CZ2 (Handle invalid commands).

Suggestions:

  1. Use our CLI to test against previous stages by running:
codecrafters test --previous

  1. Focus on fixing the early stages first, as later stages depend on them.

I see, thank you for pointing me in the right direction. My changes in i/o layer must have broken older functionalities (at least for the online judge).

Could you give this a try and see if it resolves the error?