6 use Test::More tests => 9;
21 sub new { bless {}, $_[0] }
22 sub bar { 'Foo::bar' }
25 # call the submethod in the direct instance
31 is($foo->bar(), 'Foo::bar', '... got the right return value');
33 # fail calling it from a subclass
43 my $m = sub { (shift)->next::method() };
44 subname('Bar::bar', $m);
55 my $value = eval { $bar->bar() };
56 ok(!$@, '... calling bar() succedded') || diag $@;
57 is($value, 'Foo::bar', '... got the right return value too');