X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Fmethod.t;h=aaf29be8df1d88f7d61b278ccd5ed0255226fe69;hb=3444c34c7da9f235e181b5c175a1fa1357e7a055;hp=16a927aa065d96809c14b7ca54fb6e6f09a86e91;hpb=6dc4e5ce3856b98c7d128e411610d5f3845c15f3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/method.t b/t/op/method.t index 16a927a..aaf29be 100755 --- a/t/op/method.t +++ b/t/op/method.t @@ -10,7 +10,7 @@ BEGIN { require "test.pl"; } -print "1..74\n"; +print "1..78\n"; @A::ISA = 'B'; @B::ISA = 'C'; @@ -231,7 +231,7 @@ is( Foo->boogie(), "yes, sir!"); # This is actually testing parsing of indirect objects and undefined subs # print foo("bar") where foo does not exist is not an indirect object. # print foo "bar" where foo does not exist is an indirect object. -eval { sub AUTOLOAD { "ok ", shift, "\n"; } }; +eval 'sub AUTOLOAD { "ok ", shift, "\n"; }'; ok(1); # Bug ID 20010902.002 @@ -259,3 +259,37 @@ is( is($w, ''); } +# [ID 20020305.025] PACKAGE::SUPER doesn't work anymore + +package main; +our @X; +package Amajor; +sub test { + push @main::X, 'Amajor', @_; +} +package Bminor; +use base qw(Amajor); +package main; +sub Bminor::test { + $_[0]->Bminor::SUPER::test('x', 'y'); + push @main::X, 'Bminor', @_; +} +Bminor->test('y', 'z'); +is("@X", "Amajor Bminor x y Bminor Bminor y z"); + +package main; +for my $meth (['Bar', 'Foo::Bar'], + ['SUPER::Bar', 'main::SUPER::Bar'], + ['Xyz::SUPER::Bar', 'Xyz::SUPER::Bar']) +{ + fresh_perl_is(<$meth->[0](); +EOT + "Foo $meth->[1]", + { switches => [ '-w' ] }, + "check if UNIVERSAL::AUTOLOAD works", + ); +}