summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-07-07 12:12:40 +0200
committerJim Meyering <meyering@redhat.com>2011-07-07 16:42:47 +0200
commitb358f1f2a3124a879828103c9dd612da7adb805f (patch)
treeb7614ffd4f46414f8fbd4fad76d31d924c9610e9 /tests
parent33171d049a162ca5648c7e213e9c988ea835a19b (diff)
downloadcoreutils-b358f1f2a3124a879828103c9dd612da7adb805f.tar.xz
tests: exercise md5sum's new --strict option
* tests/misc/md5sum: Exercise new --strict option.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/md5sum17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/misc/md5sum b/tests/misc/md5sum
index f09a2003d..e8877e021 100755
--- a/tests/misc/md5sum
+++ b/tests/misc/md5sum
@@ -43,6 +43,23 @@ my @Tests =
['check-1', '--check', {AUX=> {f=> ''}},
{IN=> {'f.md5' => "$degenerate f\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"},
+ {ERR=>"md5sum: "
+ . "WARNING: 1 line is improperly formatted\n"},
+ {EXIT=> 1}],
+
+ # As above, but with the invalid line first, to ensure that following
+ # 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"},
+ {ERR=>"md5sum: "
+ . "WARNING: 1 line is improperly formatted\n"},
+ {EXIT=> 1}],
['check-2', '--check', '--status', {IN=>{'f.md5' => "$degenerate f\n"}},
{AUX=> {f=> 'foo'}}, {EXIT=> 1}],
['check-quiet1', '--check', '--quiet', {AUX=> {f=> ''}},