X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F01_MRO.t;fp=t%2F01_MRO.t;h=32d99a21191154c3e653e05ab1f0079c968e79d1;hb=b9e73af7c2fca0058d6d91827363c07fee7c3867;hp=0000000000000000000000000000000000000000;hpb=b23e9cb9ccfb3d470c72b95818ce57c9b891381b;p=gitmo%2FClass-C3-XS.git diff --git a/t/01_MRO.t b/t/01_MRO.t new file mode 100644 index 0000000..32d99a2 --- /dev/null +++ b/t/01_MRO.t @@ -0,0 +1,44 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Test::More tests => 2; + +BEGIN { + use_ok('Class::C3::XS'); +} + +=pod + +This tests the classic diamond inheritence pattern. + + + / \ + + \ / + + +=cut + +{ + package Diamond_A; + our @ISA = qw//; +} +{ + package Diamond_B; + use base 'Diamond_A'; +} +{ + package Diamond_C; + use base 'Diamond_A'; +} +{ + package Diamond_D; + use base ('Diamond_B', 'Diamond_C'); +} + +is_deeply( + [ Class::C3::XS::calculateMRO('Diamond_D') ], + [ qw(Diamond_D Diamond_B Diamond_C Diamond_A) ], + '... got the right MRO for Diamond_D');