aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2025-10-07 15:24:12 +0100
committerPádraig Brady <P@draigBrady.com>2025-10-07 15:58:36 +0100
commit51f27a15b0e2a0c12f211dcd957bbb39738ff4c4 (patch)
tree86acf041ded50ce89a61b42e42ecc8a6ebe5a272 /tests
parentmaint: cksum: document a base64/hex parsing ambiguity with untagged (diff)
downloadcoreutils-51f27a15b0e2a0c12f211dcd957bbb39738ff4c4.tar.gz
coreutils-51f27a15b0e2a0c12f211dcd957bbb39738ff4c4.zip
tests: cksum: add a test case for robust file name parsing
* tests/cksum/cksum-c.sh: Add a test case where the file name contains tagged format delimiter characters.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cksum/cksum-c.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/cksum/cksum-c.sh b/tests/cksum/cksum-c.sh
index 79986d577..4f00767f5 100755
--- a/tests/cksum/cksum-c.sh
+++ b/tests/cksum/cksum-c.sh
@@ -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-----