From 516e60ed10957d163c8f967e5115ccd20f26dcbf Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 4 Oct 1998 03:01:12 +0000 Subject: [PATCH] Add tests with filenames containing newline and backslash characters. --- tests/md5sum/basic-1 | 10 ++++++++-- 1 file 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}; -- 2.11.4.GIT