summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-10-19 09:19:59 +0200
committerJim Meyering <meyering@redhat.com>2010-10-19 09:35:44 +0200
commit10a0bdfa986dc77b9c5b7171b701e77d02756759 (patch)
tree09eb8ad96f1f49ec26e9ed10c99f0a3aa3e5e6bd /tests
parent407806b27f032b3bce828ee0a152b5f67e997e09 (diff)
downloadcoreutils-10a0bdfa986dc77b9c5b7171b701e77d02756759.tar.xz
tests: trigger and test for md5sum's new diagnostics
* tests/misc/md5sum: Test for new diagnostics.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/md5sum23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/misc/md5sum b/tests/misc/md5sum
index 92cc0fb16..819a81925 100755
--- a/tests/misc/md5sum
+++ b/tests/misc/md5sum
@@ -54,6 +54,29 @@ my @Tests =
{ERR=>"md5sum: WARNING: 1 computed"
. " checksum did NOT match\n"},
{EXIT=> 1}],
+ # Exercise new-after-8.6, easier-to-translate diagnostics.
+ ['check-multifail', '--check',
+ {IN=>{'f.md5' =>
+ "$degenerate f\n"
+ . "$degenerate f\n"
+ . "invalid\n" }},
+ {AUX=> {f=> 'foo'}},
+ {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}],
+ # Similar to the above, but use --warn to evoke one more diagnostic.
+ ['check-multifail-warn', '--check', '--warn',
+ {IN=>{'f.md5' =>
+ "$degenerate f\n"
+ . "$degenerate f\n"
+ . "invalid\n" }},
+ {AUX=> {f=> 'foo'}},
+ {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"
+ . "md5sum: WARNING: 2 computed checksums did NOT match\n"},
+ {EXIT=> 1}],
# The sha1sum and md5sum drivers share a lot of code.
# Ensure that md5sum does *not* share the part that makes
# sha1sum accept BSD format.