X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCarp.t;h=c24760b153e04ebeacba564b06e8f801b41e0e8f;hb=a5cf58215d4b35afd5701a8ba967072050fb847c;hp=63e15654d1c4a3c214bcb16406ae52c6b8597ec5;hpb=d735c2efe0b08b05adfb893625476bf4480a2ece;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Carp.t b/lib/Carp.t index 63e1565..c24760b 100644 --- a/lib/Carp.t +++ b/lib/Carp.t @@ -8,7 +8,7 @@ my $Is_VMS = $^O eq 'VMS'; use Carp qw(carp cluck croak confess); -plan tests => 36; +plan tests => 37; ok 1; @@ -254,6 +254,18 @@ sub w { cluck @_ } is($?>>8, 42, 'confess() doesn\'t clobber $!'); } +# undef used to be incorrectly reported as the string "undef" +sub cluck_undef { + +local $SIG{__WARN__} = sub { + like $_[0], qr/^Bang! at.+\b(?i:carp\.t) line \d+\n\tmain::cluck_undef\(0, 'undef', 2, undef, 4\) called at.+\b(?i:carp\.t) line \d+$/, "cluck doesn't quote undef" }; + +cluck "Bang!" + +} + +cluck_undef (0, "undef", 2, undef, 4); + # line 1 "A" package A; sub short {