summaryrefslogtreecommitdiff
path: root/tests/md5sum/basic-1
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-10-04 03:01:12 +0000
committerJim Meyering <jim@meyering.net>1998-10-04 03:01:12 +0000
commit516e60ed10957d163c8f967e5115ccd20f26dcbf (patch)
treeeedd59e05a9a24d898d8c52b52f08e7506f0bfe8 /tests/md5sum/basic-1
parent61c04cdaedd1a01a484715f9e13ca0b96e0592c8 (diff)
downloadcoreutils-516e60ed10957d163c8f967e5115ccd20f26dcbf.tar.xz
Add tests with filenames containing newline and backslash characters.
Diffstat (limited to 'tests/md5sum/basic-1')
-rwxr-xr-xtests/md5sum/basic-110
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/md5sum/basic-1 b/tests/md5sum/basic-1
index 2d0571ab2..2cc6a3e81 100755
--- a/tests/md5sum/basic-1
+++ b/tests/md5sum/basic-1
@@ -19,10 +19,12 @@ use strict;
# Turn off localisation of executable's ouput.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
+my $degenerate = "d41d8cd98f00b204e9800998ecf8427e";
+
my @Tests =
(
- ['1', {IN=> {x=> ''}}, {OUT=>"d41d8cd98f00b204e9800998ecf8427e x\n"}],
- ['2', {IN=> {x=> 'a'}}, {OUT=>"0cc175b9c0f1b6a831c399e269772661 x\n"}],
+ ['1', {IN=> {x=> ''}}, {OUT=>"$degenerate x\n"}],
+ ['2', {IN=> {x=> 'a'}}, {OUT=>"0cc175b9c0f1b6a831c399e269772661 x\n"}],
['3', {IN=> {x=> 'abc'}}, {OUT=>"900150983cd24fb0d6963f7d28e17f72 x\n"}],
['4', {IN=> {x=> 'message digest'}},
{OUT=>"f96b697d7cb7938d525a2f31aaf161d0 x\n"}],
@@ -32,6 +34,10 @@ my @Tests =
{OUT=>"d174ab98d277d9f5a5611c2c9f419d9f x\n"}],
['7', {IN=> {x=> '1234567890' x 8}},
{OUT=>"57edf4a22be3c955ac49da2e2107b67a x\n"}],
+ ['backslash', {IN=> {"\\.foo"=> ''}},
+ {OUT=>"\\$degenerate \\\\.foo\n"}],
+ ['newline', {IN=> {"a\nb"=> ''}},
+ {OUT=>"\\$degenerate a\\nb\n"}],
);
my $save_temps = $ENV{DEBUG};