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 | ||
9 | require './test.pl'; | |
10 | plan(tests => 4); | |
11 | ||
12 | { | |
13 | package ᕘ; | |
14 | use strict; | |
15 | use warnings; | |
16 | use mro 'c3'; | |
17 | ||
18 | sub fಓ { 'ᕘ::fಓ' } | |
19 | ||
20 | package Fᶽ; | |
21 | use strict; | |
22 | use warnings; | |
23 | use mro 'c3'; | |
24 | use base 'ᕘ'; | |
25 | ||
26 | sub fಓ { 'Fᶽ::fಓ => ' . (shift)->next::method } | |
27 | ||
28 | package Bᛆ; | |
29 | use strict; | |
30 | use warnings; | |
31 | use mro 'c3'; | |
32 | use base 'ᕘ'; | |
33 | ||
34 | sub fಓ { 'Bᛆ::fಓ => ' . (shift)->next::method } | |
35 | ||
36 | package Baᕃ; | |
37 | use strict; | |
38 | use warnings; | |
39 | ||
40 | use base 'Bᛆ', 'Fᶽ'; | |
41 | ||
42 | sub fಓ { 'Baᕃ::fಓ => ' . (shift)->NEXT::fಓ } | |
43 | } | |
44 | ||
45 | is(ᕘ->fಓ, 'ᕘ::fಓ', '... got the right value from ᕘ->fಓ'); | |
46 | is(Fᶽ->fಓ, 'Fᶽ::fಓ => ᕘ::fಓ', '... got the right value from Fᶽ->fಓ'); | |
47 | is(Bᛆ->fಓ, 'Bᛆ::fಓ => ᕘ::fಓ', '... got the right value from Bᛆ->fಓ'); | |
48 | ||
49 | is(Baᕃ->fಓ, 'Baᕃ::fಓ => Bᛆ::fಓ => Fᶽ::fಓ => ᕘ::fಓ', '... got the right value using NEXT in a subclass of a C3 class'); | |
50 |