diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-09-12 23:11:45 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-09-12 23:11:45 +0000 |
commit | 9cb6ed42173576c510ef1c29c778425530c66d50 (patch) | |
tree | 5204ac7307802e33e16c4332352665b5ba431353 /lib/Carp.t | |
parent | 955623668f666142789ec391e521b0b6705cea7b (diff) | |
download | perl-9cb6ed42173576c510ef1c29c778425530c66d50.tar.gz |
Carp's argument backtrace code would show undef as "undef" - a string.
p4raw-id: //depot/perl@31858
Diffstat (limited to 'lib/Carp.t')
-rw-r--r-- | lib/Carp.t | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/Carp.t b/lib/Carp.t index 63e15654d1..c24760b153 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 { |