Multi-command pipelines has an invalid test

Hello,

there is a problem with the test “Running tests for Stage #XK3 (Pipelines - Multi-command pipelines)”

You create a file with 5 words and your head command gets them all. I had a bug in my code so multiple pipes were not processed correctly. Instead only the first command and the last command was piped together.

This test passed even with my bug.

You should check with head -n 3 for instance. This would have failed in my case.

[tester::#XK3] Running tests for Stage #XK3 (Pipelines - Multi-command pipelines)
[tester::#XK3] [setup] export PATH=/tmp/orange/mango/blueberry:$PATH
[tester::#XK3] [setup] echo -e “strawberry\ngrape\napple\nraspberry\nbanana” > “/tmp/pig/file-16”
[tester::#XK3] Running ./your_program.sh
[your-program] $ cat /tmp/pig/file-16 | head -n 5 | wc
[your-program] 5 5 40
[tester::#XK3] ✓ Received expected output

I recreated the file locally and tested with a real shell:
[22:37:46]-[gillouche@macbook]-[gillouche/.ssh] $ cat /tmp/file-16| head -n 5 | wc
5 5 40
[22:38:02]-[gillouche@macbook]-[gillouche/.ssh] $ cat /tmp/file-16| head -n 3 | wc
3 3 23

[22:40:30]-[gillouche@macbook]-[gillouche/.ssh] $ cat /tmp/file-16 | wc
5 5 40

Hey @gillouche, thanks for highlighting the issue! We’re addressing it in this PR.

Let us know if you spot anything else!

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