6 use Test::More tests => 12;
9 use_ok('Algorithm::C3');
14 Just like 007_cached_merge, but test the MROs in some wierd order, rather
15 than alphabetical order.
17 This example is taken from: http://rt.cpan.org/Public/Bug/Display.html?id=20879
20 Level 5 8 | A | 9 | B | A | C | (More General)
32 Level 3 4 | G | 6 | E | |
37 Level 2 3 | H | 5 | F | |
45 Level 1 1 | J | 2 | I | |
50 Level 0 0 | K | (More Specialized)
70 use base qw/Test::A Test::B Test::C/;
85 use base qw/Test::H Test::F/;
91 use base qw/Test::J Test::I/;
102 [ Algorithm::C3::merge('Test::J', \&supers, \%cache) ],
103 [ qw(Test::J Test::F Test::E Test::D Test::A Test::B Test::C) ],
104 '... got the right C3 merge order for Test::J');
107 [ Algorithm::C3::merge('Test::G', \&supers, \%cache) ],
108 [ qw(Test::G Test::D Test::A Test::B Test::C) ],
109 '... got the right C3 merge order for Test::G');
112 [ Algorithm::C3::merge('Test::B', \&supers, \%cache) ],
114 '... got the right C3 merge order for Test::B');
117 [ Algorithm::C3::merge('Test::D', \&supers, \%cache) ],
118 [ qw(Test::D Test::A Test::B Test::C) ],
119 '... got the right C3 merge order for Test::D');
122 [ Algorithm::C3::merge('Test::C', \&supers, \%cache) ],
124 '... got the right C3 merge order for Test::C');
127 [ Algorithm::C3::merge('Test::I', \&supers, \%cache) ],
128 [ qw(Test::I Test::H Test::G Test::F Test::E Test::D Test::A Test::B Test::C) ],
129 '... got the right C3 merge order for Test::I');
132 [ Algorithm::C3::merge('Test::K', \&supers, \%cache) ],
133 [ qw(Test::K Test::J Test::I Test::H Test::G Test::F Test::E Test::D Test::A Test::B Test::C) ],
134 '... got the right C3 merge order for Test::K');
137 [ Algorithm::C3::merge('Test::E', \&supers, \%cache) ],
138 [ qw(Test::E Test::D Test::A Test::B Test::C) ],
139 '... got the right C3 merge order for Test::E');
142 [ Algorithm::C3::merge('Test::F', \&supers, \%cache) ],
143 [ qw(Test::F Test::E Test::D Test::A Test::B Test::C) ],
144 '... got the right C3 merge order for Test::F');
147 [ Algorithm::C3::merge('Test::A', \&supers, \%cache) ],
149 '... got the right C3 merge order for Test::A');
152 [ Algorithm::C3::merge('Test::H', \&supers, \%cache) ],
153 [ qw(Test::H Test::G Test::D Test::A Test::B Test::C) ],
154 '... got the right C3 merge order for Test::H');