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)
71 return @{ $foo->{ $_[0] } };
75 [ Algorithm::C3::merge('a', \&supers) ],
77 '... got the right C3 merge order for a');
80 [ Algorithm::C3::merge('b', \&supers) ],
82 '... got the right C3 merge order for b');
85 [ Algorithm::C3::merge('c', \&supers) ],
87 '... got the right C3 merge order for c');
90 [ Algorithm::C3::merge('d', \&supers) ],
92 '... got the right C3 merge order for d');
95 [ Algorithm::C3::merge('e', \&supers) ],
97 '... got the right C3 merge order for e');
100 [ Algorithm::C3::merge('f', \&supers) ],
102 '... got the right C3 merge order for f');
105 [ Algorithm::C3::merge('g', \&supers) ],
107 '... got the right C3 merge order for g');
110 [ Algorithm::C3::merge('h', \&supers) ],
112 '... got the right C3 merge order for h');
115 [ Algorithm::C3::merge('i', \&supers) ],
116 [ qw(i h g f e d a b c) ],
117 '... got the right C3 merge order for i');
120 [ Algorithm::C3::merge('j', \&supers) ],
121 [ qw(j f e d a b c) ],
122 '... got the right C3 merge order for j');
125 [ Algorithm::C3::merge('k', \&supers) ],
126 [ qw(k j i h g f e d a b c) ],
127 '... got the right C3 merge order for k');