From: Nicholas Clark Date: Thu, 8 Oct 2009 18:30:08 +0000 (+0200) Subject: Move the test for RT #49472 to op/attrs.t from comp/require.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8314a0a6723be4c95f56df951e17c556a4936c12;p=p5sagit%2Fp5-mst-13.2.git Move the test for RT #49472 to op/attrs.t from comp/require.t --- diff --git a/t/comp/require.t b/t/comp/require.t index d561ad6..032a147 100644 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -15,7 +15,7 @@ krunch.pm krunch.pmc whap.pm whap.pmc); my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0; my $Is_UTF8 = (${^OPEN} || "") =~ /:utf8/; -my $total_tests = 50; +my $total_tests = 49; if ($Is_EBCDIC || $Is_UTF8) { $total_tests -= 3; } print "1..$total_tests\n"; @@ -257,20 +257,6 @@ EOT } } -# [perl #49472] Attributes + Unkown Error - -{ - do_require - 'use strict;sub MODIFY_CODE_ATTRIBUTE{} sub f:Blah {$nosuchvar}'; - my $err = $@; - $err .= "\n" unless $err =~ /\n$/; - unless ($err =~ /Global symbol "\$nosuchvar" requires /) { - $err =~ s/^/# /mg; - print "${err}not "; - } - print "ok ", ++$i, " [perl #49472]\n"; -} - ########################################## # What follows are UTF-8 specific tests. # # Add generic tests before this point. # diff --git a/t/op/attrs.t b/t/op/attrs.t index ef6867d..8f059b0 100644 --- a/t/op/attrs.t +++ b/t/op/attrs.t @@ -14,7 +14,7 @@ BEGIN { use warnings; -plan 90; +plan 91; $SIG{__WARN__} = sub { die @_ }; @@ -197,6 +197,18 @@ sub PVBM () { 'foo' } ok !defined(attributes::get(\PVBM)), 'PVBMs don\'t segfault attributes::get'; +{ + # [perl #49472] Attributes + Unkown Error + eval ' + use strict; + sub MODIFY_CODE_ATTRIBUTE{} + sub f:Blah {$nosuchvar}; + '; + + my $err = $@; + like ($err, qr/Global symbol "\$nosuchvar" requires /, 'perl #49472'); +} + # Test that code attributes always get applied to the same CV that # we're left with at the end (bug#66970). {