use strict;
use warnings;
-use Test::More tests => 11;
-
-BEGIN {
- use_ok('Class::C3');
- # uncomment this line, and re-run the
- # test to see the normal p5 dispatch order
- #$Class::C3::TURN_OFF_C3 = 1;
-}
+use Test::More tests => 14;
=pod
use Class::C3;
}
+Class::C3::initialize();
+
is_deeply(
[ Class::C3::calculateMRO('Test::F') ],
[ qw(Test::F Test::O) ],
is(Test::A->C_or_E, 'Test::C', '... got the expected method output');
is(Test::A->can('C_or_E')->(), 'Test::C', '... can got the expected method output');
-
\ No newline at end of file
+# remove the C3
+Class::C3::uninitialize();
+
+is(Test::A->C_or_D, 'Test::D', '... old method resolution has been restored');
+is(Test::A->can('C_or_D')->(), 'Test::D', '... old can(method) resolution has been restored');
+
+is(Test::A->C_or_E, 'Test::E', '... old method resolution has been restored');
+is(Test::A->can('C_or_E')->(), 'Test::E', '... old can(method) resolution has been restored');
+
+