]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: cksum: add a test case for robust file name parsing
authorPádraig Brady <P@draigBrady.com>
Tue, 7 Oct 2025 14:24:12 +0000 (15:24 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 7 Oct 2025 14:58:36 +0000 (15:58 +0100)
* tests/cksum/cksum-c.sh: Add a test case where the file name
contains tagged format delimiter characters.

tests/cksum/cksum-c.sh

index 79986d577850f675a5e9b96059303fc7990b9017..4f00767f5fea6dc94f7e0b2f3680828fbf424997 100755 (executable)
@@ -57,6 +57,12 @@ compare experr err || fail=1
 # Ensure leading whitespace and \ ignored
 sed 's/^/ \\/' CHECKSUMS | cksum --strict -c || fail=1
 
+# Ensure file names with " (=" supported.
+awkward_file='abc (f) = abc'
+touch "$awkward_file" || framework_failure_
+cksum -a sha1 "$awkward_file" > tag-awkward.sum || framework_failure_
+cksum --check tag-awkward.sum || fail=1
+
 # Check common signed checksums format works in non strict mode
 cat >> signed_CHECKSUMS <<\EOF
 -----BEGIN PGP SIGNED MESSAGE-----