summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-08-16 00:03:06 +0000
committerJim Meyering <jim@meyering.net>1998-08-16 00:03:06 +0000
commite646635206283e677f92170b35b318dc66b59042 (patch)
tree96c17446ae3f5be9dd7598b1f6b8e30deb589ff2 /tests
parentea9e600f5847a8ebb5d85a9495b0de6734ae7f1b (diff)
downloadcoreutils-e646635206283e677f92170b35b318dc66b59042.tar.xz
*** empty log message ***
Diffstat (limited to 'tests')
-rw-r--r--tests/ls-2/Fetish.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/ls-2/Fetish.pm b/tests/ls-2/Fetish.pm
index 5997aa27b..15978dc0e 100644
--- a/tests/ls-2/Fetish.pm
+++ b/tests/ls-2/Fetish.pm
@@ -12,13 +12,15 @@ use FileHandle;
use File::Compare qw(compare);
@ISA = qw(Exporter);
-($VERSION = '$Revision: 1.5 $ ') =~ tr/[0-9].//cd;
+($VERSION = '$Revision: 1.6 $ ') =~ tr/[0-9].//cd;
@EXPORT = qw (run_tests);
my @Types = qw (IN OUT ERR EXIT);
my %Types = map {$_ => 1} @Types;
my %Zero_one_type = map {$_ => 1} qw (OUT ERR EXIT);
+my $srcdir = $ENV{srcdir};
+
# A file spec: a scalar or a reference to a single-keyed hash
# ================
# 'contents' contents only (file name is derived from test name)
@@ -177,7 +179,8 @@ sub run_tests ($$$$$)
die "$program_name: $test_name: invalid RHS in $type-spec\n"
}
- my $is_junk_file = (! defined $file_name);
+ my $is_junk_file = (! defined $file_name
+ || ($type eq 'IN' && defined $contents));
my $file = _create_file ($program_name, $test_name, $type,
$file_name, $contents);
if ($type eq 'IN')
@@ -198,7 +201,7 @@ sub run_tests ($$$$$)
# FIXME: put $srcdir in here somewhere
warn "$program_name: $test_name: specified file `$file' does"
. " not exist\n"
- if ! -f $file;
+ if ! -f "$srcdir/$file";
}
}