mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
tests: wc: ensure -c counts all of a file when descriptors run out
Reported at https://github.com/uutils/coreutils/issues/15742 * tests/wc/page-size.sh: Add a test case. Link: https://github.com/coreutils/coreutils/pull/446
This commit is contained in:
1 parent
0201866781
commit
a15203bb8c
1 file changed
+9
@@ -48,4 +48,13 @@ for multiple in $(seq 3); do
|
||||
compare /dev/null err || fail=1
|
||||
done
|
||||
|
||||
# Ensure 'wc -c FILE' reports the whole size of a page-multiple file
|
||||
# when no descriptors are left for other ways of counting.
|
||||
if (ulimit -n 4 && cat file > /dev/null) 2> /dev/null; then
|
||||
(ulimit -n 4 && wc -c file > out 2> err) || fail=1
|
||||
echo "$file_size file" > exp || framework_failure_
|
||||
compare exp out || fail=1
|
||||
compare /dev/null err || fail=1
|
||||
fi
|
||||
|
||||
Exit $fail
|
||||
Reference in new issue
Block a user