diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-11-30 22:35:16 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-12-01 05:20:42 -0800 |
commit | a5cd004dbd757df2bcf9e17aab6a8ed1272157d7 (patch) | |
tree | bf8d3b1283f343bf14457a3817915f3928be043b /t/mro | |
parent | f32becadbe83ee90251793094dc804d84cef87a0 (diff) | |
download | perl-a5cd004dbd757df2bcf9e17aab6a8ed1272157d7.tar.gz |
[perl #68654] next::method doesn't see UNIVERSAL
This commit makes next::method retry with UNIVERSAL if it reaches the
end of the MRO list.
Diffstat (limited to 't/mro')
-rw-r--r-- | t/mro/next_edgecases.t | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/t/mro/next_edgecases.t b/t/mro/next_edgecases.t index c0da963ede..e77ce7be31 100644 --- a/t/mro/next_edgecases.t +++ b/t/mro/next_edgecases.t @@ -5,7 +5,7 @@ use warnings; BEGIN { chdir 't'; require q(./test.pl); @INC = qw "../lib lib" } -plan(tests => 12); +plan(tests => 14); { @@ -93,3 +93,19 @@ plan(tests => 12); is($@, '', "->next::can on non-existing package name"); } + +# Test next::method with UNIVERSAL methods +{ + package UNIVERSAL; + sub foo { "foo" } + our @ISA = "a"; + package a; + sub bar { "bar" } + package M; + sub foo { shift->next::method } + sub bar { shift->next::method } + package main; + + is eval { M->foo }, "foo", 'next::method with implicit UNIVERSAL'; + is eval { M->bar }, "bar", 'n::m w/superclass of implicit UNIVERSAL'; +} |