summaryrefslogtreecommitdiff
path: root/tests/misc/sha1sum.pl
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2013-11-01 16:14:44 +0000
committerPádraig Brady <P@draigBrady.com>2013-11-01 22:34:24 +0000
commit4d94e65d06772c41b8ac11e8b55f749c57c18f5b (patch)
tree833345afed768a30fa9486a683253201c80167f5 /tests/misc/sha1sum.pl
parent979f59f77c69535ff1fb916f73a88658db04df0b (diff)
downloadcoreutils-4d94e65d06772c41b8ac11e8b55f749c57c18f5b.tar.xz
maint: simplify printing of md5sum file names
* src/md5sum.c (main): Add a comment as to why we continue to escape names that do not have '\n' but do have '\\' chars. (print_filename): Use the predetermined boolean to decide whether to escape or not, so that in the common case we can output the file name directly, rather than inspecting each char. * tests/misc/md5sum.pl: Add case to show '\\' chars cause escaping. * tests/misc/sha1sum.pl: Likewise.
Diffstat (limited to 'tests/misc/sha1sum.pl')
-rwxr-xr-xtests/misc/sha1sum.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/misc/sha1sum.pl b/tests/misc/sha1sum.pl
index 327c4dd89..730ca0804 100755
--- a/tests/misc/sha1sum.pl
+++ b/tests/misc/sha1sum.pl
@@ -44,7 +44,9 @@ my @Tests =
{OUT=>"50abf5706a150990a08b2c5ea40fa0e585554732 f\n"}],
['million-a', {IN=> {f=> 'a' x 1000000}},
{OUT=>"34aa973cd4c4daa4f61eeb2bdbad27316534016f f\n"}],
- ['bs-sha', {IN=> {".\\foo"=> ''}},
+ ['bs-sha-1', {IN=> {".\nfoo"=> ''}},
+ {OUT=>"\\$sha_degenerate .\\nfoo\n"}],
+ ['bs-sha-2', {IN=> {".\\foo"=> ''}},
{OUT=>"\\$sha_degenerate .\\\\foo\n"}],
# The sha1sum and md5sum drivers share a lot of code.
# Ensure that sha1sum does *not* share the part that makes