6 use open qw( :utf8 :std );
8 require q(./test.pl); plan(tests => 5);
12 This tests the classic diamond inheritance pattern.
25 sub 헬ฬ { 'Diӑmond_A::헬ฬ' }
26 sub fಓ { 'Diӑmond_A::fಓ' }
32 sub fಓ { 'Diӑmond_B::fಓ => ' . (shift)->next::method() }
39 sub 헬ฬ { 'Diӑmond_C::헬ฬ => ' . (shift)->next::method() }
40 sub fಓ { 'Diӑmond_C::fಓ => ' . (shift)->next::method() }
44 use base ('Diӑmond_B', 'Diӑmond_C');
47 sub fಓ { 'Diӑmond_D::fಓ => ' . (shift)->next::method() }
51 mro::get_linear_isa('Diӑmond_D'),
52 [ qw(Diӑmond_D Diӑmond_B Diӑmond_C Diӑmond_A) ]
53 ), '... got the right MRO for Diӑmond_D');
55 is(Diӑmond_D->헬ฬ, 'Diӑmond_C::헬ฬ => Diӑmond_A::헬ฬ', '... method resolved itself as expected');
57 is(Diӑmond_D->can('헬ฬ')->('Diӑmond_D'),
58 'Diӑmond_C::헬ฬ => Diӑmond_A::헬ฬ',
59 '... can(method) resolved itself as expected');
61 is(UNIVERSAL::can("Diӑmond_D", '헬ฬ')->('Diӑmond_D'),
62 'Diӑmond_C::헬ฬ => Diӑmond_A::헬ฬ',
63 '... can(method) resolved itself as expected');
66 'Diӑmond_D::fಓ => Diӑmond_B::fಓ => Diӑmond_C::fಓ => Diӑmond_A::fಓ',
67 '... method fಓ resolved itself as expected');