[Go][Stage #IP1] Shell command execution works but test assertions fails

Hi,

My tests are failing for some reason, I see that my program prints "$ " but still assertion fails. Here’s the logs from my test run, hoping it might help:

Initiating test run...

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

Running tests. Logs should appear shortly...

[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.

Debug = true

[tester::#IP1] Running tests for Stage #IP1 (Run a program)
[tester::#IP1] [setup] export PATH=/tmp/baz:$PATH
[tester::#IP1] [setup] Available executables:
[tester::#IP1] [setup] - custom_exe_4640
[tester::#IP1] Running ./your_program.sh
[your-program] $ custom_exe_4640 Maria
[your-program] Program was passed 2 args (including program name).
[your-program] Arg #0 (program name): custom_exe_4640
[your-program] Arg #1: Maria
[your-program] Program Signature: 5195206196
[tester::#IP1] Expected prompt ("$ ") but received ""
[your-program] $
[tester::#IP1] Assertion failed.
[tester::#IP1] Test failed

I’m on windows machine using wsl
Thanks for any feedback.

The Issue was in my code I was doing fmt.Println() which was introducing new line character. but the cmd that I was executing already had new line character. Switching to fmt.Print() worked out.

1 Like

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