Commit | Line | Data |
---|---|---|
204e6232 BF |
1 | #!/usr/bin/perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | use NEXT; | |
6 | use utf8; | |
7 | use open qw( :utf8 :std ); | |
8 | ||
b5efbd1f | 9 | chdir 't' if -d 't'; |
204e6232 BF |
10 | require './test.pl'; |
11 | plan(tests => 4); | |
12 | ||
13 | { | |
14 | package ᕘ; | |
15 | use strict; | |
16 | use warnings; | |
17 | use mro 'c3'; | |
18 | ||
19 | sub fಓ { 'ᕘ::fಓ' } | |
20 | ||
21 | package Fᶽ; | |
22 | use strict; | |
23 | use warnings; | |
24 | use mro 'c3'; | |
25 | use base 'ᕘ'; | |
26 | ||
27 | sub fಓ { 'Fᶽ::fಓ => ' . (shift)->next::method } | |
28 | ||
29 | package Bᛆ; | |
30 | use strict; | |
31 | use warnings; | |
32 | use mro 'c3'; | |
33 | use base 'ᕘ'; | |
34 | ||
35 | sub fಓ { 'Bᛆ::fಓ => ' . (shift)->next::method } | |
36 | ||
37 | package Baᕃ; | |
38 | use strict; | |
39 | use warnings; | |
40 | ||
41 | use base 'Bᛆ', 'Fᶽ'; | |
42 | ||
43 | sub fಓ { 'Baᕃ::fಓ => ' . (shift)->NEXT::fಓ } | |
44 | } | |
45 | ||
46 | is(ᕘ->fಓ, 'ᕘ::fಓ', '... got the right value from ᕘ->fಓ'); | |
47 | is(Fᶽ->fಓ, 'Fᶽ::fಓ => ᕘ::fಓ', '... got the right value from Fᶽ->fಓ'); | |
48 | is(Bᛆ->fಓ, 'Bᛆ::fಓ => ᕘ::fಓ', '... got the right value from Bᛆ->fಓ'); | |
49 | ||
50 | is(Baᕃ->fಓ, 'Baᕃ::fಓ => Bᛆ::fಓ => Fᶽ::fಓ => ᕘ::fಓ', '... got the right value using NEXT in a subclass of a C3 class'); | |
51 |