diff options
author | Pádraig Brady <P@draigBrady.com> | 2015-11-01 18:48:22 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2015-11-04 02:03:43 +0000 |
commit | 646902b30dee04b9454fdcaa8a30fd89fc0514ca (patch) | |
tree | 50241e5b349a1de2a7094d8ffcd900de0458c655 /tests | |
parent | ab40a941a07d80326aaa051e3c94c88b800cbd7d (diff) | |
download | coreutils-646902b30dee04b9454fdcaa8a30fd89fc0514ca.tar.xz |
md5sum: ensure a single status line per file
* src/md5sum.c: Use the same file name escaping method used
when generating and checking checksums. I.E. ensure a single line
per file by starting the line with '\' for any file name containing '\n'
and replacing those with "\\n".
* NEWS: Move the item from changes in behavior to improvements,
since this is no longer a backwards incompat change when
processing stdout status messages.
* tests/misc/md5sum.pl: Remove quotes from expected status output.
* tests/misc/sha1sum.pl: Likewise.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/misc/md5sum.pl | 16 | ||||
-rwxr-xr-x | tests/misc/sha1sum.pl | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/misc/md5sum.pl b/tests/misc/md5sum.pl index d29a4efa7..c99658213 100755 --- a/tests/misc/md5sum.pl +++ b/tests/misc/md5sum.pl @@ -44,12 +44,12 @@ my @Tests = {OUT=>"\\$degenerate .\\\\foo\n"}], ['check-1', '--check', {AUX=> {f=> ''}}, {IN=> {'f.md5' => "$degenerate f\n"}}, - {OUT=>"'f': OK\n"}], + {OUT=>"f: OK\n"}], # Same as above, but with an added empty line, to provoke --strict. ['ck-strict-1', '--check --strict', {AUX=> {f=> ''}}, {IN=> {'f.md5' => "$degenerate f\n\n"}}, - {OUT=>"'f': OK\n"}, + {OUT=>"f: OK\n"}, {ERR=>"md5sum: " . "WARNING: 1 line is improperly formatted\n"}, {EXIT=> 1}], @@ -58,7 +58,7 @@ my @Tests = # lines are processed in spite of the preceding invalid input line. ['ck-strict-2', '--check --strict', {AUX=> {f=> ''}}, {IN=> {'in.md5' => "\n$degenerate f\n"}}, - {OUT=>"'f': OK\n"}, + {OUT=>"f: OK\n"}, {ERR=>"md5sum: " . "WARNING: 1 line is improperly formatted\n"}, {EXIT=> 1}], @@ -69,7 +69,7 @@ my @Tests = {OUT=>""}], ['check-quiet2', '--check', '--quiet', {IN=>{'f.md5' => "$degenerate f\n"}}, - {AUX=> {f=> 'foo'}}, {OUT=>"'f': FAILED\n"}, + {AUX=> {f=> 'foo'}}, {OUT=>"f: FAILED\n"}, {ERR=>"md5sum: WARNING: 1 computed" . " checksum did NOT match\n"}, {EXIT=> 1}], @@ -80,7 +80,7 @@ my @Tests = . "$degenerate f\n" . "invalid\n" }}, {AUX=> {f=> 'foo'}}, - {OUT=>"'f': FAILED\n'f': FAILED\n"}, + {OUT=>"f: FAILED\nf: FAILED\n"}, {ERR=>"md5sum: WARNING: 1 line is improperly formatted\n" . "md5sum: WARNING: 2 computed checksums did NOT match\n"}, {EXIT=> 1}], @@ -91,7 +91,7 @@ my @Tests = . "$degenerate f\n" . "invalid\n" }}, {AUX=> {f=> 'foo'}}, - {OUT=>"'f': FAILED\n'f': FAILED\n"}, + {OUT=>"f: FAILED\nf: FAILED\n"}, {ERR=>"md5sum: 'f.md5': 3: " . "improperly formatted MD5 checksum line\n" . "md5sum: WARNING: 1 line is improperly formatted\n" @@ -106,7 +106,7 @@ my @Tests = . "MD5 checksum lines found\n"}, {EXIT=> 1}], ['check-bsd2', '--check', {IN=> {'f.md5' => "MD5 (f) = $degenerate\n"}}, - {AUX=> {f=> ''}}, {OUT=>"'f': OK\n"}], + {AUX=> {f=> ''}}, {OUT=>"f: OK\n"}], ['check-bsd3', '--check', '--status', {IN=> {'f.md5' => "MD5 (f) = $degenerate\n"}}, {AUX=> {f=> 'bar'}}, {EXIT=> 1}], @@ -116,7 +116,7 @@ my @Tests = . "MD5 checksum lines found\n"}, {EXIT=> 1}], ['check-openssl2', '--check', {IN=> {'f.md5' => "MD5(f)= $degenerate\n"}}, - {AUX=> {f=> ''}}, {OUT=>"'f': OK\n"}], + {AUX=> {f=> ''}}, {OUT=>"f: OK\n"}], ['check-openssl3', '--check', '--status', {IN=> {'f.md5' => "MD5(f)= $degenerate\n"}}, {AUX=> {f=> 'bar'}}, {EXIT=> 1}], diff --git a/tests/misc/sha1sum.pl b/tests/misc/sha1sum.pl index 0c22e7a18..b58a7f4a1 100755 --- a/tests/misc/sha1sum.pl +++ b/tests/misc/sha1sum.pl @@ -58,7 +58,7 @@ my @Tests = {EXIT=> 1}], ['check-bsd2', '--check', {IN=> {'f.sha1' => "SHA1 (f) = $sha_degenerate\n"}}, - {AUX=> {f=> ''}}, {OUT=>"'f': OK\n"}], + {AUX=> {f=> ''}}, {OUT=>"f: OK\n"}], ['check-bsd3', '--check', '--status', {IN=> {'f.sha1' => "SHA1 (f) = $sha_degenerate\n"}}, {AUX=> {f=> 'bar'}}, {EXIT=> 1}], @@ -70,7 +70,7 @@ my @Tests = {EXIT=> 1}], ['check-openssl2', '--check', {IN=> {'f.sha1' => "SHA1(f)= $sha_degenerate\n"}}, - {AUX=> {f=> ''}}, {OUT=>"'f': OK\n"}], + {AUX=> {f=> ''}}, {OUT=>"f: OK\n"}], ['check-openssl3', '--check', '--status', {IN=> {'f.sha1' => "SHA1(f)= $sha_degenerate\n"}}, {AUX=> {f=> 'bar'}}, {EXIT=> 1}], |