I noticed an issue with the shell project’s stderr redirection test (#UN3). The test assumes a file doesn’t exist when it was just created by previous test steps.
Relevant test logs:
[your-program] $ echo "James says Error" 2>> /tmp/baz/qux.md
[your-program] James says Error
[tester::#UN3] ✓ Received redirected file content
[your-program] $ cat nonexistent 2>> /tmp/baz/qux.md
[your-program] $ ls -1 nonexistent 2>> /tmp/baz/qux.md
[your-program] $ cat /tmp/baz/qux.md
[your-program] cat /tmp/baz/qux.md
[tester::#UN3] Output does not match expected value.
[tester::#UN3] Expected: "cat: nonexistent: No such file or directory"
[tester::#UN3] Received: "cat /tmp/baz/qux.md"
The test attempts to verify error redirection after the file already exists from previous steps. This makes the test unreliable.
Suggested fixes:
Clean up test files between assertions
Use unique file paths for each test case
Verify file existence before assertions
What do you think? Happy to provide more details or help implement a fix.
Hey,
I just stumbled on this topic and I’m not sure if I’m reading this correct. The file that doesn’t exist is named: nonexistent and from what I see in the logs you provided doesn’t seem to be created earlier. The test fails because the cat command should display the contents of /tmp/baz/qux.md but instead it just repeats for some reason. From what I’m seeing the issue is with the cat command not behaving as expected.