6 use Test::More tests => 12;
9 use_ok('Algorithm::C3');
14 This example is taken from: http://rt.cpan.org/Public/Bug/Display.html?id=20879
17 Level 5 8 | A | 9 | B | A | C | (More General)
29 Level 3 4 | G | 6 | E | |
34 Level 2 3 | H | 5 | F | |
42 Level 1 1 | J | 2 | I | |
47 Level 0 0 | K | (More Specialized)
67 use base qw/Test::A Test::B Test::C/;
82 use base qw/Test::H Test::F/;
88 use base qw/Test::J Test::I/;
97 [ Algorithm::C3::merge('Test::A', \&supers) ],
99 '... got the right C3 merge order for Test::A');
102 [ Algorithm::C3::merge('Test::B', \&supers) ],
104 '... got the right C3 merge order for Test::B');
107 [ Algorithm::C3::merge('Test::C', \&supers) ],
109 '... got the right C3 merge order for Test::C');
112 [ Algorithm::C3::merge('Test::D', \&supers) ],
113 [ qw(Test::D Test::A Test::B Test::C) ],
114 '... got the right C3 merge order for Test::D');
117 [ Algorithm::C3::merge('Test::E', \&supers) ],
118 [ qw(Test::E Test::D Test::A Test::B Test::C) ],
119 '... got the right C3 merge order for Test::E');
122 [ Algorithm::C3::merge('Test::F', \&supers) ],
123 [ qw(Test::F Test::E Test::D Test::A Test::B Test::C) ],
124 '... got the right C3 merge order for Test::F');
127 [ Algorithm::C3::merge('Test::G', \&supers) ],
128 [ qw(Test::G Test::D Test::A Test::B Test::C) ],
129 '... got the right C3 merge order for Test::G');
132 [ Algorithm::C3::merge('Test::H', \&supers) ],
133 [ qw(Test::H Test::G Test::D Test::A Test::B Test::C) ],
134 '... got the right C3 merge order for Test::H');
137 [ Algorithm::C3::merge('Test::I', \&supers) ],
138 [ qw(Test::I Test::H Test::G Test::F Test::E Test::D Test::A Test::B Test::C) ],
139 '... got the right C3 merge order for Test::I');
142 [ Algorithm::C3::merge('Test::J', \&supers) ],
143 [ qw(Test::J Test::F Test::E Test::D Test::A Test::B Test::C) ],
144 '... got the right C3 merge order for Test::J');
147 [ Algorithm::C3::merge('Test::K', \&supers) ],
148 [ qw(Test::K Test::J Test::I Test::H Test::G Test::F Test::E Test::D Test::A Test::B Test::C) ],
149 '... got the right C3 merge order for Test::K');