fix maybe::next version
[gitmo/Class-C3.git] / t / 03_MRO.t
index 0b098cf..182926c 100644 (file)
@@ -3,14 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 5;
-
-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 => 7;
 
 =pod
 
@@ -94,6 +87,8 @@ Level 0                0 | A |
     use Class::C3;
 }
 
+Class::C3::initialize();
+
 is_deeply(
     [ Class::C3::calculateMRO('Test::A') ],
     [ qw(Test::A Test::B Test::E Test::C Test::D Test::F Test::O) ],
@@ -107,3 +102,9 @@ is(Test::A->O_or_F, 'Test::F', '... got the right method dispatch');
 # would actually call Test::D before Test::C and Test::D is a
 # subclass of Test::C 
 is(Test::A->C_or_D, 'Test::C', '... got the right method dispatch');    
+
+Class::C3::uninitialize();
+
+is(Test::A->O_or_D, 'Test::O', '... old dispatch order is restored');    
+is(Test::A->O_or_F, 'Test::O', '... old dispatch order is restored');   
+is(Test::A->C_or_D, 'Test::D', '... old dispatch order is restored');