]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: cksum: check when several files are missing or incorrect
authorSylvestre Ledru <sylvestre@debian.org>
Mon, 1 Jul 2024 21:45:09 +0000 (23:45 +0200)
committerPádraig Brady <P@draigBrady.com>
Tue, 2 Jul 2024 08:11:14 +0000 (09:11 +0100)
 * tests/cksum/cksum-c.sh: Add test cases when several files with errors

tests/cksum/cksum-c.sh

index 3ead1450440f2664de8f588a28e3f6d6a2f4f70c..b07fc941896fc00638f6d0cf2369c2c929a21ca7 100755 (executable)
@@ -143,4 +143,15 @@ test -s out || fail=1
 grep 'CHECKSUMS-missing: no file was verified' out || fail=1
 grep -v 'nonexistent: No such file or directory' stdout && fail=1
 
+# Check with several files
+# When the files don't exist
+cksum --check non-existing-1 non-existing-2 > out 2>&1 && fail=1
+grep -v 'non-existing-1: No such file or directory' out || fail=1
+grep -v 'non-existing-2: No such file or directory' out || fail=1
+
+# When the files are empty
+touch empty-1 empty-2
+cksum --check empty-1 empty-2 > out 2>&1 && fail=1
+grep -v 'empty-1: no properly formatted checksum lines found' out || fail=1
+grep -v 'empty-2: no properly formatted checksum lines found' out || fail=1
 Exit $fail