summaryrefslogtreecommitdiff
path: root/ext/Safe
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2002-03-13 14:22:50 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-03-14 14:19:41 +0000
commitfd0dd3148086454cc57c02485c7d1989d923c2d6 (patch)
treefec828c24afde04b6d1e55fc061cc89978e30421 /ext/Safe
parent3a8b863a2f806d23ab2ff35e466eff783be3b05b (diff)
downloadperl-fd0dd3148086454cc57c02485c7d1989d923c2d6.tar.gz
Re: PATCH proposal for ext/Safe/safe2.t
Message-ID: <20020313142250.G92566@plum.flirble.org> p4raw-id: //depot/perl@15223
Diffstat (limited to 'ext/Safe')
-rwxr-xr-xext/Safe/safe2.t15
1 files changed, 8 insertions, 7 deletions
diff --git a/ext/Safe/safe2.t b/ext/Safe/safe2.t
index 4d6c84a692..18230e2d69 100755
--- a/ext/Safe/safe2.t
+++ b/ext/Safe/safe2.t
@@ -8,9 +8,6 @@ BEGIN {
print "1..0\n";
exit 0;
}
- # test 30 rather naughtily expects English error messages
- $ENV{'LC_ALL'} = 'C';
- $ENV{LANGUAGE} = 'C'; # GNU locale extension
}
# Tests Todo:
@@ -121,12 +118,16 @@ print $@ =~ /foo bar/ ? "ok 29\n" : "not ok 29\n";
# --- rdo
+my $nosuch = '/non/existant/file.name';
+open(NOSUCH, $nosuch);
+my $errno = $! + 0;
+close(NOSUCH);
+
my $t = 30;
-$cpt->rdo('/non/existant/file.name');
-# The regexp is getting rather baroque.
-print $! =~ /cannot find|No such file|file specification syntax error|A file or directory in the path name does not exist|Invalid argument|Device not configured|file not found|File or directory doesn't exist/i ? "ok $t\n" : "not ok $t # $!\n"; $t++;
+$cpt->rdo($nosuch);
+print $! == $errno ? "ok $t\n" : sprintf "not ok $t # \"$!\" is %d (expected %d)\n", $!, $errno; $t++;
# test #31 is gone.
-print 1 ? "ok $t\n" : "not ok $t\n#$@/$!\n"; $t++;
+print "ok $t\n"; $t++;
#my $rdo_file = "tmp_rdo.tpl";
#if (open X,">$rdo_file") {