blob: ec24564cad6849ce6b3b39d2783e439585e4012e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
BEGIN {
if ($ENV{PERL_CORE}) {
chdir('t') if -d 't';
@INC = qw(../lib);
}
}
BEGIN { print "1..5\n"; }
use NEXT;
my $count=1;
package A;
@ISA = qw/B C D/;
sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::test;}
package B;
@ISA = qw/C D/;
sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::test;}
package C;
@ISA = qw/D/;
sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::test;}
package D;
sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::test;}
package main;
my $foo = {};
bless($foo,"A");
$foo->test;
package Diamond::Base;
sub test { print "ok ", $count++, "\n"; shift->NEXT::UNSEEN::test; }
package Diamond::Left; @ISA = qw[Diamond::Base];
package Diamond::Right; @ISA = qw[Diamond::Base];
package Diamond::Top; @ISA = qw[Diamond::Left Diamond::Right];
package main;
Diamond::Top->test;
|