I’m stuck on Stage #JV1
I’ve tried the exact same test manually in local, and I think I get the right output, so that’s why I’m very confused.
Here are the logs from the tests execution of JV1:
remote: Running tests on your code. Logs should appear shortly...
remote:
remote: [compile] Moved ./.codecrafters/run.sh → ./your_program.sh
remote: [compile] Compilation successful.
remote:
remote: [tester::#JV1] Running tests for Stage #JV1 (Redirection - Redirect stdout)
remote: [tester::#JV1] Running ./your_program.sh
remote: [tester::#JV1] Writing file "/tmp/foo/banana" with content "banana"
remote: [tester::#JV1] Writing file "/tmp/foo/mango" with content "mango"
remote: [tester::#JV1] Writing file "/tmp/foo/pineapple" with content "pineapple"
remote: [your-program] $ ls -1 /tmp/foo > /tmp/qux/baz.md
remote: [your-program] $ cat /tmp/qux/baz.md
remote: [your-program] banana
remote: [your-program] mango
remote: [your-program] pineapple
remote: [tester::#JV1] ✓ Received redirected file content
remote: [your-program] $ echo 'Hello Maria' 1> /tmp/qux/qux.md
remote: [your-program] $ cat /tmp/qux/qux.md
remote: [your-program] Hello Maria
remote: [tester::#JV1] ✓ Received redirected file content
remote: [your-program] $ cat /tmp/foo/mango nonexistent 1> /tmp/qux/quz.md
remote: [your-program] $
remote: [tester::#JV1] Output does not match expected value.
remote: [tester::#JV1] Expected: "cat: nonexistent: No such file or directory"
remote: [tester::#JV1] Received: "$ "
remote: [tester::#JV1] Assertion failed.
remote: [tester::#JV1] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)
My code is uploaded to GitHub - pabloprz/codecrafters-shell-go
This is my “local” execution running my code:
$ mkdir /tmp/foo
$ echo mango > /tmp/foo/mango
$ cat /tmp/foo/mango
mango
$ mkdir /tmp/qux
$ cat /tmp/foo/mango nonexistent 1> /tmp/qux/quz.md
cat: nonexistent: No such file or directory
$ cat /tmp/qux/quz.md
mango
$
From the test error it seems like a newline is printed instead of the cat error, but that’s not what I reproduce manually executing my code.
Any help is very much appreciated, thanks!