fortrangoingonforty/fortsh / a51cc75

Browse files

fix: filter broken pipe errors from pipeline-with-failures test. posix-coverage 271.2 [skip-pty]

Authored by espadonne
SHA
a51cc75e155424d6316e744a8ca99c337c185832
Parents
2d9f611
Tree
4702691

1 changed file

StatusFile+-
M tests/posix_compliance_coverage.sh 6 1
tests/posix_compliance_coverage.shmodified
@@ -333,7 +333,12 @@ compare_posix_output "pipeline with :" ': | echo piped'
333333
 section "271. PIPELINE - LONG CHAINS"
334334
 
335335
 compare_posix_output "5-stage pipeline" 'echo test | cat | cat | cat | cat | cat'
336
-compare_posix_output "pipeline with failures" 'echo ok | false | cat; echo $?'
336
+# Pipeline timing can produce non-deterministic pipe errors — filter them out
337
+TEST_NUM=$((TEST_NUM + 1))
338
+_pf_expected=$(FORTSH_RC_FILE=/dev/null "$BASH_REF" -c 'echo ok | false | cat; echo $?' 2>&1 | grep -v 'Broken pipe' | normalize_output)
339
+_pf_actual=$(FORTSH_RC_FILE=/dev/null "$FORTSH_BIN" -c 'echo ok | false | cat; echo $?' 2>&1 | grep -v 'Broken pipe' | normalize_output)
340
+if [ "$_pf_expected" = "$_pf_actual" ]; then pass "pipeline with failures"
341
+else fail "pipeline with failures" "$_pf_expected" "$_pf_actual"; fi
337342
 
338343
 # =====================================
339344
 # ALIAS EDGE CASES