6 use Test::More tests => 12;
9 use_ok('Algorithm::C3');
14 Just like 006_complex_merge, but with the caching turned on.
16 This example is taken from: http://rt.cpan.org/Public/Bug/Display.html?id=20879
19 Level 5 8 | A | 9 | B | A | C | (More General)
31 Level 3 4 | G | 6 | E | |
36 Level 2 3 | H | 5 | F | |
44 Level 1 1 | J | 2 | I | |
49 Level 0 0 | K | (More Specialized)
69 use base qw/Test::A Test::B Test::C/;
84 use base qw/Test::H Test::F/;
90 use base qw/Test::J Test::I/;
101 [ Algorithm::C3::merge('Test::A', \&supers, \%cache) ],
103 '... got the right C3 merge order for Test::A');
106 [ Algorithm::C3::merge('Test::B', \&supers, \%cache) ],
108 '... got the right C3 merge order for Test::B');
111 [ Algorithm::C3::merge('Test::C', \&supers, \%cache) ],
113 '... got the right C3 merge order for Test::C');
116 [ Algorithm::C3::merge('Test::D', \&supers, \%cache) ],
117 [ qw(Test::D Test::A Test::B Test::C) ],
118 '... got the right C3 merge order for Test::D');
121 [ Algorithm::C3::merge('Test::E', \&supers, \%cache) ],
122 [ qw(Test::E Test::D Test::A Test::B Test::C) ],
123 '... got the right C3 merge order for Test::E');
126 [ Algorithm::C3::merge('Test::F', \&supers, \%cache) ],
127 [ qw(Test::F Test::E Test::D Test::A Test::B Test::C) ],
128 '... got the right C3 merge order for Test::F');
131 [ Algorithm::C3::merge('Test::G', \&supers, \%cache) ],
132 [ qw(Test::G Test::D Test::A Test::B Test::C) ],
133 '... got the right C3 merge order for Test::G');
136 [ Algorithm::C3::merge('Test::H', \&supers, \%cache) ],
137 [ qw(Test::H Test::G Test::D Test::A Test::B Test::C) ],
138 '... got the right C3 merge order for Test::H');
141 [ Algorithm::C3::merge('Test::I', \&supers, \%cache) ],
142 [ qw(Test::I Test::H Test::G Test::F Test::E Test::D Test::A Test::B Test::C) ],
143 '... got the right C3 merge order for Test::I');
146 [ Algorithm::C3::merge('Test::J', \&supers, \%cache) ],
147 [ qw(Test::J Test::F Test::E Test::D Test::A Test::B Test::C) ],
148 '... got the right C3 merge order for Test::J');
151 [ Algorithm::C3::merge('Test::K', \&supers, \%cache) ],
152 [ qw(Test::K Test::J Test::I Test::H Test::G Test::F Test::E Test::D Test::A Test::B Test::C) ],
153 '... got the right C3 merge order for Test::K');