10 This tests that Class::MOP works correctly
11 with Class::C3 and it's somewhat insane
12 approach to method resolution.
18 plan skip_all => "Class::C3 required for this test" if $@;
25 use metaclass; # everyone will just inherit this now :)
27 sub hello { 'Diamond_A::hello' }
39 sub hello { 'Diamond_C::hello' }
43 use base ('Diamond_B', 'Diamond_C');
47 # we have to manually initialize
48 # Class::C3 since we potentially
49 # skip this test if it is not present
50 Class::C3::initialize();
53 [ Class::C3::calculateMRO('Diamond_D') ],
54 [ qw(Diamond_D Diamond_B Diamond_C Diamond_A) ],
55 '... got the right MRO for Diamond_D');
57 ok(Diamond_A->meta->has_method('hello'), '... A has a method hello');
58 ok(!Diamond_B->meta->has_method('hello'), '... B does not have a method hello');
59 ok(defined &Diamond_B::hello, '... B does have an alias to the method hello');
61 ok(Diamond_C->meta->has_method('hello'), '... C has a method hello');
62 ok(!Diamond_D->meta->has_method('hello'), '... D does not have a method hello');
63 ok(defined &Diamond_D::hello, '... D does have an alias to the method hello');