6 use Test::More tests => 5;
10 # uncomment this line, and re-run the
11 # test to see the normal p5 dispatch order
12 #$Class::C3::TURN_OFF_C3 = 1;
17 This tests the classic diamond inheritence pattern.
30 sub hello { 'Diamond_A::hello' }
42 sub hello { 'Diamond_C::hello' }
46 use base ('Diamond_B', 'Diamond_C');
51 [ Class::C3::calculateMRO('Diamond_D') ],
52 [ qw(Diamond_D Diamond_B Diamond_C Diamond_A) ],
53 '... got the right MRO for Diamond_D');
55 is(Diamond_D->hello, 'Diamond_C::hello', '... method resolved itself as expected');
56 is(Diamond_D->can('hello')->(), 'Diamond_C::hello', '... can(method) resolved itself as expected');
58 is(UNIVERSAL::can("Diamond_D", 'hello')->(), 'Diamond_C::hello', '... can(method) resolved itself as expected');