From 92359d2df0801ffcbf461588214451b8acffb762 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 24 May 2003 16:49:40 +0000 Subject: Make sure `sha1sum --check' doesn't accept the BSD format. --- tests/sha1sum/basic-1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/sha1sum/basic-1 b/tests/sha1sum/basic-1 index 8910185b9..e2a708d57 100755 --- a/tests/sha1sum/basic-1 +++ b/tests/sha1sum/basic-1 @@ -39,13 +39,21 @@ my @Tests = {OUT=>"50abf5706a150990a08b2c5ea40fa0e585554732 f\n"}], ['bs-sha', {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 + # md5sum accept BSD format. + ['check-bsd', '--check', {IN=> {'f.md5' => "MD5 (f) = $sha_degenerate\n"}}, + {AUX=> {f=> ''}}, + {ERR=>"sha1sum: f.md5: no properly formatted " + . "SHA1 checksum lines found\n"}, + {EXIT=> 1}], ); # Insert the `--text' argument for each test. my $t; foreach $t (@Tests) { - splice @$t, 1, 0, '--text'; + splice @$t, 1, 0, '--text' unless @$t[1] =~ /--check/; } my $save_temps = $ENV{DEBUG}; -- cgit v1.2.3-70-g09d2