diff options
author | Pádraig Brady <P@draigBrady.com> | 2023-04-26 16:20:50 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2023-04-26 16:20:50 +0100 |
commit | 5e1c5f2d71eb99bc3c73619eeb0b79c3d36b5a3b (patch) | |
tree | b0726a6b743792006b7a0a6793c5149e8fdccf30 | |
parent | 4eb5abbff4e9ddfcb0537bfc75ded89ca739dbfb (diff) | |
download | coreutils-5e1c5f2d71eb99bc3c73619eeb0b79c3d36b5a3b.tar.gz |
tests: more cases for read input diagnostics
* tests/misc/read-errors.sh: Exercise more modes of
various utilities for better read error coverage.
* tests/split/fail.sh: Remove part refactored into the above test.
-rwxr-xr-x | tests/misc/read-errors.sh | 26 | ||||
-rwxr-xr-x | tests/split/fail.sh | 7 |
2 files changed, 21 insertions, 12 deletions
diff --git a/tests/misc/read-errors.sh b/tests/misc/read-errors.sh index 288c3ecc2..7f395bb9e 100755 --- a/tests/misc/read-errors.sh +++ b/tests/misc/read-errors.sh @@ -37,7 +37,8 @@ cksum -a sm3 . cksum -a sysv . comm . . csplit . 1 -cut -b1 . +cut -c1 . +cut -f1 . date -f . dd if=. dircolors . @@ -45,7 +46,10 @@ expand . factor < . fmt . fold . -head . +head -n1 . +head -n-1 . +head -c1 . +head -c-1 . join . . nl . numfmt < . @@ -53,17 +57,29 @@ od . paste . pr . ptx . -shuf . +shuf -r . +shuf -n1 . sort . -split . +split -l1 . +split -b1 . +split -C1 . +split -n1 . +split -nl/1 . +split -nr/1 . tac . -tail . +tail -n1 . +tail -c1 . +tail -n+1 . +tail -c+1 . tee < . tr 1 1 < . tsort . unexpand . uniq . +uniq -c . wc . +wc -c . +wc -l . " | sort -k 1b,1 > all_readers || framework_failure_ diff --git a/tests/split/fail.sh b/tests/split/fail.sh index b8d54ea71..0884d6267 100755 --- a/tests/split/fail.sh +++ b/tests/split/fail.sh @@ -58,11 +58,4 @@ returns_ 1 split --number=r/$UINTMAX_OFLOW </dev/null 2>/dev/null || fail=1 # Make sure that a huge obsolete option does the right thing. split -99999999999999999991 in || fail=1 -# Make sure split fails when it can't read input -# (the current directory in this case) -if ! cat . >/dev/null; then - # can't read() directories - returns_ 1 split . || fail=1 -fi - Exit $fail |