]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: csplit: check for message to standard output after read fails
authorCollin Funk <collin.funk1@gmail.com>
Sat, 27 Jun 2026 19:48:19 +0000 (12:48 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Sat, 27 Jun 2026 19:48:19 +0000 (12:48 -0700)
* tests/csplit/csplit.sh: Add a test case.

tests/csplit/csplit.sh

index b3865b706449ec94119a24fa79116e2b04800be5..5cb180dd15957e24abdd5f9eda46ca5383a05891 100755 (executable)
@@ -110,4 +110,15 @@ csplit: '1': line number out of range
 EOF
 compare experr err || fail=1
 
+# Test that the message to standard output isn't elided after read fails.
+rm -f xx?? || framework_failure_
+echo 0 >exp-out || framework_failure_
+cat <<\EOF >exp-err || framework_failure_
+csplit: read error: Is a directory
+EOF
+returns_ 1 csplit -k . '/^a/' >out 2>err || fail=1
+compare /dev/null xx00 || fail=1
+compare exp-out out || fail=1
+compare exp-err err || fail=1
+
 Exit $fail