X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCarp.t;h=2ce5eb4dff92da278a3c38d7e40f96ae02bf095c;hb=e82b93481bc82235f35444c372503cc96abe405b;hp=d07e202d1564ac7ff8f634e31f72154c6895b96a;hpb=62e1ddac2ea58cd2a35011515be4801254772ba8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Carp.t b/lib/Carp.t index d07e202..2ce5eb4 100644 --- a/lib/Carp.t +++ b/lib/Carp.t @@ -4,6 +4,8 @@ BEGIN { require './test.pl'; } +my $Is_VMS = $^O eq 'VMS'; + use Carp qw(carp cluck croak confess); plan tests => 21; @@ -156,8 +158,18 @@ sub w { cluck @_ } } } -# Check that croak() and confess() don't clobber $! -runperl(prog => 'use Carp; $@=q{Phooey}; $!=42; croak(q{Dead})', stderr => 1); -is($?>>8, 42, 'croak() doesn\'t clobber $!'); -runperl(prog => 'use Carp; $@=q{Phooey}; $!=42; confess(q{Dead})', stderr => 1); -is($?>>8, 42, 'confess() doesn\'t clobber $!'); + +{ + local $TODO = "VMS exit status semantics don't work this way" if $Is_VMS; + + # Check that croak() and confess() don't clobber $! + runperl(prog => 'use Carp; $@=q{Phooey}; $!=42; croak(q{Dead})', + stderr => 1); + + is($?>>8, 42, 'croak() doesn\'t clobber $!'); + + runperl(prog => 'use Carp; $@=q{Phooey}; $!=42; confess(q{Dead})', + stderr => 1); + + is($?>>8, 42, 'confess() doesn\'t clobber $!'); +}