]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
test: truncate: improve the test added in the previous commit
authorCollin Funk <collin.funk1@gmail.com>
Fri, 20 Mar 2026 06:14:52 +0000 (23:14 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Fri, 20 Mar 2026 06:17:47 +0000 (23:17 -0700)
* tests/truncate/multiple-files.sh: Check that nothing is printed to
standard output and that standard error has the correct error.

tests/truncate/multiple-files.sh

index dfde9fac2c63a54ec34f9860b6a78573740dd69f..d7a984c4205a4f9d6f0df97fba596199c4fe25dd 100755 (executable)
 
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ truncate
+getlimits_
 
-returns_ 1 truncate -s0 a . b || fail=1
+returns_ 1 truncate -s0 a . b > out 2> err || fail=1
 test -f a || fail=1
 test -f b || fail=1
+compare /dev/null out || fail=1
+cat <<EOF > exp-err || framework_failure_
+truncate: cannot open '.' for writing: $EISDIR
+EOF
+compare exp-err err || fail=1
+
 
 Exit $fail