X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F03_MRO.t;h=a13294fa9289ef6dbd6c98bd0ea614621b462ca1;hb=97d515483413d7a64828d301be6f92b30c4da9a7;hp=0b098cf4f0c274d05be25f60cb1896ab8711dd29;hpb=d401eda1e68a148b69c4e4992de7814fcaa44225;p=gitmo%2FClass-C3.git diff --git a/t/03_MRO.t b/t/03_MRO.t index 0b098cf..a13294f 100644 --- a/t/03_MRO.t +++ b/t/03_MRO.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 8; BEGIN { use_ok('Class::C3'); @@ -94,6 +94,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 +109,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');