]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Make sure `sha1sum --check' doesn't accept the BSD format.
authorJim Meyering <jim@meyering.net>
Sat, 24 May 2003 16:49:40 +0000 (16:49 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 24 May 2003 16:49:40 +0000 (16:49 +0000)
tests/sha1sum/basic-1

index 8910185b980f026ba922d4104a4960cc1158afb2..e2a708d578a172447307b9d3c99a16fba8bf43e9 100755 (executable)
@@ -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};