1#!./perl
2
3use strict;
4use warnings;
5use utf8;
6use open qw( :utf8 :std );
7
8require q(./test.pl); plan(tests => 2);
9
10=pod
11
12This tests a strange bug found by Matt S. Trout
13while building DBIx::Class. Thanks Matt!!!!
14
15   <A>
16  /   \
17<C>   <B>
18  \   /
19   <D>
20
21=cut
22
23{
24    packageiᚪၚd_A;
25    use mro 'c3';
26
27    sub ᕘ { 'Diᚪၚd_A::ᕘ' }
28}
29{
30    packageiᚪၚd_B;
31    use base 'Diᚪၚd_A';
32    use mro 'c3';
33
34    sub ᕘ { 'Diᚪၚd_B::ᕘ => ' . (shift)->SUPER::ᕘ }
35}
36{
37    packageiᚪၚd_C;
38    use mro 'c3';
39    use base 'Diᚪၚd_A';
40
41}
42{
43    packageiᚪၚd_D;
44    use base ('Diᚪၚd_C', 'Diᚪၚd_B');
45    use mro 'c3';
46
47    sub ᕘ { 'Diᚪၚd_D::ᕘ => ' . (shift)->SUPER::ᕘ }
48}
49
50ok(eq_array(
51    mro::get_linear_isa('Diᚪၚd_D'),
52    [ qw(Diᚪၚd_Diᚪၚd_Ciᚪၚd_Biᚪၚd_A) ]
53), '... got the right MRO for Diᚪၚd_D');
54
55is(Diᚪၚd_D->ᕘ,
56   'Diᚪၚd_D::ᕘ => Diᚪၚd_B::ᕘ => Diᚪၚd_A::ᕘ',
57   '... got the right next::method dispatch path');
58