7 plan(skip_all => "This test is only applicable for perl >= 5.9.5");
8 } elsif ( ! eval { require MRO::Compat } || $@) {
9 plan(skip_all => "MRO::Compat not available");
10 } elsif ( ! eval { require Class::C3 } || $@) {
11 plan(skip_all => "Class::C3 not available");
18 # If the bug still exists, I should get a few warnings
20 local $SIG{__WARN__} = sub {
21 push @warnings, $_[0];
24 # Remove symbols from respective tables, and
25 # remove from INC, so we force re-evaluation
26 foreach my $class (qw(Class::C3 MRO::Compat)) {
33 { # Don't do this at home, kids!
35 foreach my $key (keys %{ "${class}::" }) {
36 delete ${"${class}::"}{$key};
45 ok( ! $@, "Class::C3 loaded ok");
46 if (! ok( ! @warnings, "loading Class::C3 did not generate warnings" )) {
47 diag("Generated warnings are (expecting 'subroutine redefined...')");
48 diag(" $_") for @warnings;