diff options
author | Jim Meyering <jim@meyering.net> | 1998-08-15 19:23:40 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-08-15 19:23:40 +0000 |
commit | 14717b8618e8f890b2d778a6a27416d9e6d2a7fc (patch) | |
tree | 3c4bc22f22a9855ecbfdfa16159fc6e896f056c9 /tests | |
parent | dc8cd6e39a81858161ab2cdb28f01b4ea638c61f (diff) | |
download | coreutils-14717b8618e8f890b2d778a6a27416d9e6d2a7fc.tar.xz |
*** empty log message ***
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ls-2/T.pm | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/tests/ls-2/T.pm b/tests/ls-2/T.pm index 3e4f200dd..da0b6a367 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$/) { |