From: Father Chrysostomos Date: Fri, 18 May 2012 20:37:40 +0000 (-0700) Subject: overload.t: Move some tests above ‘keep last’ test X-Git-Tag: upstream/5.20.0~6821^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=929e99945d25016c2ab768359ac6d69cda826013;p=platform%2Fupstream%2Fperl.git overload.t: Move some tests above ‘keep last’ test --- diff --git a/lib/overload.t b/lib/overload.t index a10fd4e..6efbf0f 100644 --- a/lib/overload.t +++ b/lib/overload.t @@ -2201,38 +2201,6 @@ fresh_perl_is 'Error message when sub stub is encountered'; } -sub eleventative::cos { 'eleven' } -sub twelvetative::abs { 'twelve' } -sub thirteentative::abs { 'thirteen' } -sub fourteentative::abs { 'fourteen' } -@eleventative::ISA = twelvetative::; -{ - my $o = bless [], 'eleventative'; - eval 'package eleventative; use overload map +($_)x2, cos=>abs=>'; - is cos $o, 'eleven', 'overloading applies to object blessed before'; - bless [], 'eleventative'; - is cos $o, 'eleven', - 'ovrld applies to previously-blessed obj after other obj is blessed'; - $o = bless [], 'eleventative'; - *eleventative::cos = sub { 'ten' }; - is cos $o, 'ten', 'method changes affect overloading'; - @eleventative::ISA = thirteentative::; - is abs $o, 'thirteen', 'isa changes affect overloading'; - bless $o, 'fourteentative'; - @fourteentative::ISA = 'eleventative'; - local our $TODO = '[perl #112708]'; - is abs $o, 'fourteen', 'isa changes can turn overloading on'; -} - -{ # undefining the overload stash -- KEEP THIS TEST LAST - package ant; - use overload '+' => 'onion'; - $_ = \&overload::nil; - undef %overload::; - bless[]; - ::ok(1, 'no crash when undefining %overload::'); -} - # [perl #40333] # overload::Overloaded should not use a ->can designed for autoloading. # This example attempts to be as realistic as possible. The o class has a @@ -2267,5 +2235,37 @@ ok !overload::Overloaded(new proxy new o), ok(overload::Overloaded($obj)); } +sub eleventative::cos { 'eleven' } +sub twelvetative::abs { 'twelve' } +sub thirteentative::abs { 'thirteen' } +sub fourteentative::abs { 'fourteen' } +@eleventative::ISA = twelvetative::; +{ + my $o = bless [], 'eleventative'; + eval 'package eleventative; use overload map +($_)x2, cos=>abs=>'; + is cos $o, 'eleven', 'overloading applies to object blessed before'; + bless [], 'eleventative'; + is cos $o, 'eleven', + 'ovrld applies to previously-blessed obj after other obj is blessed'; + $o = bless [], 'eleventative'; + *eleventative::cos = sub { 'ten' }; + is cos $o, 'ten', 'method changes affect overloading'; + @eleventative::ISA = thirteentative::; + is abs $o, 'thirteen', 'isa changes affect overloading'; + bless $o, 'fourteentative'; + @fourteentative::ISA = 'eleventative'; + local our $TODO = '[perl #112708]'; + is abs $o, 'fourteen', 'isa changes can turn overloading on'; +} + +{ # undefining the overload stash -- KEEP THIS TEST LAST + package ant; + use overload '+' => 'onion'; + $_ = \&overload::nil; + undef %overload::; + bless[]; + ::ok(1, 'no crash when undefining %overload::'); +} + # EOF