From: Jim Meyering Date: Sat, 15 Aug 1998 19:23:40 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: FILEUTILS-3_16u~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14717b8618e8f890b2d778a6a27416d9e6d2a7fc;p=thirdparty%2Fcoreutils.git *** empty log message *** --- diff --git a/tests/ls-2/T.pm b/tests/ls-2/T.pm index 3e4f200dd6..da0b6a3678 100644 --- a/tests/ls-2/T.pm +++ b/tests/ls-2/T.pm @@ -11,10 +11,7 @@ use File::Compare qw(compare); $VERSION = '0.5'; @EXPORT = qw (run_tests); -my @Types = qw (IN_FILE IN_DATA - OUT_FILE OUT_DATA - ERR_FILE ERR_DATA - EXIT_STATUS); +my @Types = qw (OUT ERR EXIT); my %Types = map {$_ => 1} @Types; my $count = 1; @@ -86,16 +83,31 @@ sub run_tests ($$$$$) next; } - die "$program_name: $test_name: invalid test spec\n" - if ref $arg ne 'HASH'; - # FIXME: reenable this test - #die "$program_name: $test_name: invalid hash in test spec\n" - # if scalar %$arg != 1; - - my ($data, $type) = each %$arg; - - die "$program_name: $test_name: `$type': invalid in test spec\n" - if ! $Types{$type}; + my $type; + my $fs; + if (ref $arg eq 'HASH') + { + my $n = keys %$arg; + die "$program_name: $test_name: output spec has $n element --" + . " expected 1\n" + if $n != 1; + ($type, $fs) = each %$arg; + die "$program_name: $test_name: `$type': invalid in test spec\n" + if ! $Types{$type}; + } + elsif (ref $arg eq 'ARRAY') + { + my $n = @$arg; + die "$program_name:: input file spec has $n element --" + . " expected 1\n" + if $n != 1; + $fs = $arg->[0]; + $type = 'IN'; + } + else + { + die "$program_name: $test_name: invalid test spec\n"; + } if ($type =~ /_FILE$/ || $type =~ /_DATA$/) {