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