From: Father Chrysostomos Date: Sun, 4 Aug 2013 06:08:42 +0000 (-0700) Subject: Test that __PACKAGE__ is read-only X-Git-Tag: upstream/5.20.0~2505 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9dbc968d1a9a9f1e73f1da3d0cd81229c81b27ab;p=platform%2Fupstream%2Fperl.git Test that __PACKAGE__ is read-only I.e., test that this bug is fixed: $ perl -e 'for(1..10){for(__PACKAGE__){warn $_; $_++}}' main at -e line 1. maio at -e line 1. maip at -e line 1. maiq at -e line 1. mair at -e line 1. mais at -e line 1. mait at -e line 1. maiu at -e line 1. maiv at -e line 1. maiw at -e line 1. for my$p(__PACKAGE__){$p++for+1..55664 ,;!print"Just another \u$p hacker,\n"} --- diff --git a/t/comp/parser.t b/t/comp/parser.t index 38a7dc8..5f0d407 100644 --- a/t/comp/parser.t +++ b/t/comp/parser.t @@ -8,7 +8,7 @@ BEGIN { chdir 't'; } -print "1..156\n"; +print "1..157\n"; sub failed { my ($got, $expected, $name) = @_; @@ -477,6 +477,11 @@ $test write(); } +for(__PACKAGE__) { + eval '$_=42'; + is $_, 'main', '__PACKAGE__ is read-only'; +} + # Add new tests HERE (above this line) # bug #74022: Loop on characters in \p{OtherIDContinue}