From: Jarkko Hietaniemi Date: Thu, 14 Mar 2002 14:24:44 +0000 (+0000) Subject: Extra paranoia from Nicholas Clark. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f74a0ddcd18792b0845e58ab5ed72a9dab201f8b;p=p5sagit%2Fp5-mst-13.2.git Extra paranoia from Nicholas Clark. p4raw-id: //depot/perl@15224 --- diff --git a/ext/Safe/safe2.t b/ext/Safe/safe2.t index 18230e2..ddd1943 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++;