From: Collin Funk Date: Wed, 1 Jul 2026 02:45:24 +0000 (-0700) Subject: tests: csplit: avoid a false failure on NetBSD X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c234d7555a0dbc0f28d1947137ed6cf79589305;p=thirdparty%2Fcoreutils.git tests: csplit: avoid a false failure on NetBSD * tests/csplit/csplit.sh: Don't run the test if calling read on a directory file descriptor works. Reported by Bruno Haible. --- diff --git a/tests/csplit/csplit.sh b/tests/csplit/csplit.sh index cb1deb1581..44189138fc 100755 --- a/tests/csplit/csplit.sh +++ b/tests/csplit/csplit.sh @@ -111,16 +111,18 @@ EOF compare experr err || fail=1 # Test that the message to standard output isn't elided after read fails. -echo 0 >exp-out || framework_failure_ -cat <<\EOF >exp-err || framework_failure_ +if ! cat . >/dev/null 2>&1; then + echo 0 >exp-out || framework_failure_ + cat <<\EOF >exp-err || framework_failure_ csplit: read error: Is a directory EOF -for opt in '' '-k'; do - rm -f xx?? || framework_failure_ - returns_ 1 csplit $opt . '/^a/' >out 2>err || fail=1 - compare /dev/null xx00 || fail=1 - compare exp-out out || fail=1 - compare exp-err err || fail=1 -done + for opt in '' '-k'; do + rm -f xx?? || framework_failure_ + returns_ 1 csplit $opt . '/^a/' >out 2>err || fail=1 + compare /dev/null xx00 || fail=1 + compare exp-out out || fail=1 + compare exp-err err || fail=1 + done +fi Exit $fail