BEGIN { chdir 't'; require q(./test.pl); @INC = qw "../lib lib" }
-plan(tests => 17);
+plan(tests => 12);
{
can_ok($bar, 'bar');
my $value = eval { $bar->bar() };
- ok(!$@, '... calling bar() succedded') || diag $@;
+ ok(!$@, '... calling bar() succeeded') || diag $@;
is($value, 'Foo::bar', '... got the right return value too');
}
is($@, '', "->next::can on non-existing package name");
}
-
-# Test next::method/can with UNIVERSAL methods
-{
- package UNIVERSAL;
- sub foo { "foo" }
- sub kan { shift->next::can }
- our @ISA = "a";
- package a;
- sub bar { "bar" }
- sub baz { shift->next::can }
- 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';
-
- is baz a, undef,
- 'univ superclasses next::cannot their own methods';
- is kan UNIVERSAL, undef,
- 'UNIVERSAL next::cannot its own methods';
-
- @a::ISA = 'b';
- sub b::cnadd { shift->next::can }
- is baz b, \&a::baz,
- 'univ supersuperclass noxt::can method in its immediate subclasses';
-}