6 use open qw( :utf8 :std );
8 require q(./test.pl); plan(tests => 4);
12 This example is take from: http://www.python.org/2.3/mro.html
31 Level 2 2 | E | 4 | D | | F | 5
37 Level 1 1 | B | | C | 3
46 (<class '__main__.A'>, <class '__main__.B'>, <class '__main__.E'>,
47 <class '__main__.C'>, <class '__main__.D'>, <class '__main__.F'>,
56 sub ᴼ_or_Ḋ { '텟ţ::ᴼ' }
57 sub ᴼ_or_Ḟ { '텟ţ::ᴼ' }
63 sub ᴼ_or_Ḟ { '텟ţ::Ḟ' }
73 sub ᴼ_or_Ḋ { '텟ţ::Ḋ' }
74 sub ƈ_or_Ḋ { '텟ţ::Ḋ' }
77 use base ('텟ţ::Ḋ', '텟ţ::Ḟ');
80 sub ƈ_or_Ḋ { '텟ţ::ƈ' }
83 use base ('텟ţ::ऍ', '텟ţ::Ḋ');
87 use base ('텟ţ::ᛒ', '텟ţ::ƈ');
92 mro::get_linear_isa('텟ţ::ଅ'),
93 [ qw(텟ţ::ଅ 텟ţ::ᛒ 텟ţ::ऍ 텟ţ::ƈ 텟ţ::Ḋ 텟ţ::Ḟ 텟ţ::ᴼ) ]
94 ), '... got the right MRO for 텟ţ::ଅ');
96 is(텟ţ::ଅ->ᴼ_or_Ḋ, '텟ţ::Ḋ', '... got the right method dispatch');
97 is(텟ţ::ଅ->ᴼ_or_Ḟ, '텟ţ::Ḟ', '... got the right method dispatch');
100 # this test is particularly interesting because the p5 dispatch
101 # would actually call 텟ţ::Ḋ before 텟ţ::ƈ and 텟ţ::Ḋ is a
103 is(텟ţ::ଅ->ƈ_or_Ḋ, '텟ţ::ƈ', '... got the right method dispatch');