6 use Test::More tests => 11;
21 sub hello { 'Diamond_A::hello' }
32 sub goodbye { 'Diamond_C::goodbye' }
33 sub hello { 'Diamond_C::hello' }
37 use base ('Diamond_B', 'Diamond_C');
40 our @hello = qw(h e l l o);
42 our %hello = (h => 1, e => 2, l => "3 & 4", o => 5)
45 Class::C3::initialize();
47 is(Diamond_D->hello, 'Diamond_C::hello', '... method resolves with the correct MRO');
48 is(Diamond_D->goodbye, 'Diamond_C::goodbye', '... method resolves with the correct MRO');
51 no warnings 'redefine';
53 *{"Diamond_D::goodbye"} = sub { 'Diamond_D::goodbye' };
56 is(Diamond_D->goodbye, 'Diamond_D::goodbye', '... method overwritten');
58 is($Diamond_D::hello, 'hello', '... our SCALAR package vars are here');
62 '... our ARRAY package vars are here');
65 { h => 1, e => 2, l => "3 & 4", o => 5 },
66 '... our HASH package vars are here');
68 Class::C3::uninitialize();
70 is(Diamond_D->hello, 'Diamond_A::hello', '... method resolves with reinitialized MRO');
71 is(Diamond_D->goodbye, 'Diamond_D::goodbye', '... uninitialize does not mess with the manually changed method');
73 is($Diamond_D::hello, 'hello', '... our SCALAR package vars are still here');
77 '... our ARRAY package vars are still here');
80 { h => 1, e => 2, l => "3 & 4", o => 5 },
81 '... our HASH package vars are still here');