]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix issues with fold-characters.sh test
authorPádraig Brady <P@draigBrady.com>
Wed, 17 Sep 2025 13:17:39 +0000 (14:17 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 17 Sep 2025 14:32:47 +0000 (15:32 +0100)
This was noticed with:

  trap '' PIPE &&  # Ignore SIGPIPE
  make check TESTS=tests/fold/fold-characters.sh SUBDIRS=.

* tests/fold/fold-characters.sh: Move memory limit test to ...
* tests/misc/write-errors.sh: ... which avoids "write error"
messages on stderr due to the ignored SIGPIPE.  It also protects
the fold invocation with a timeout(1) so that fold implementations
that don't exit promptly upon write error don't hang the test suite
(Like we would have done before commit v9.7-311-gc95c7ee76).

tests/fold/fold-characters.sh
tests/misc/write-errors.sh

index c29b4bdd6ddda0f1ceff2f72770b17a8e54cd447..8be54061bde1d1093e45b18e57a0b771292661c3 100755 (executable)
@@ -91,10 +91,4 @@ test $({ bad_unicode | fold; bad_unicode; } | uniq | wc -l) = 1 || fail=1
 # Check bad character at EOF
 test $(env printf '\xC3' | fold | wc -c) = 1 || fail=1
 
-# Ensure bounded memory operation
-vm=$(get_min_ulimit_v_ fold /dev/null) && {
-  yes | tr -d '\n' | (ulimit -v $(($vm+8000)) && fold 2>err) | head || fail=1
-  compare /dev/null err || fail=1
-}
-
 Exit $fail
index 5bc381f5f81ef9b033618a86ce6f70ead4bdc18d..34bed5dfc83c21ae853fa2779b6c866f5138721c 100755 (executable)
@@ -37,6 +37,7 @@ factor --version; yes 1 | factor
 fold /dev/zero
 fold -b /dev/zero
 fold -c /dev/zero
+fold --version; yes | tr -d '\\n' | fold
 head -z -n-1 /dev/zero
 join -a 1 -z /dev/zero /dev/null
 # TODO: nl --version; yes | nl