summaryrefslogtreecommitdiff
path: root/ext/Safe
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-03-14 14:24:44 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-03-14 14:24:44 +0000
commitf74a0ddcd18792b0845e58ab5ed72a9dab201f8b (patch)
tree7117941e2a52ac61ec229285b24014880afdd0ca /ext/Safe
parentfd0dd3148086454cc57c02485c7d1989d923c2d6 (diff)
downloadperl-f74a0ddcd18792b0845e58ab5ed72a9dab201f8b.tar.gz
Extra paranoia from Nicholas Clark.
p4raw-id: //depot/perl@15224
Diffstat (limited to 'ext/Safe')
-rwxr-xr-xext/Safe/safe2.t12
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/Safe/safe2.t b/ext/Safe/safe2.t
index 18230e2d69..ddd1943005 100755
--- a/ext/Safe/safe2.t
+++ b/ext/Safe/safe2.t
@@ -118,14 +118,18 @@ print $@ =~ /foo bar/ ? "ok 29\n" : "not ok 29\n";
# --- rdo
+my $t = 30;
my $nosuch = '/non/existant/file.name';
open(NOSUCH, $nosuch);
-my $errno = $! + 0;
+if ($@) {
+ my $errno = $!;
+ $cpt->rdo($nosuch);
+ print $! == $errno ? "ok $t\n" : sprintf "not ok $t # \"$!\" is %d (expected %d)\n", $!, $errno; $t++;
+} else {
+ die "Eek! Didn't expect $nosuch to be there.";
+}
close(NOSUCH);
-my $t = 30;
-$cpt->rdo($nosuch);
-print $! == $errno ? "ok $t\n" : sprintf "not ok $t # \"$!\" is %d (expected %d)\n", $!, $errno; $t++;
# test #31 is gone.
print "ok $t\n"; $t++;