--- /dev/null
+#!/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.
+
+ <A>
+ / \
+<B> <C>
+ \ /
+ <D>
+
+=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');
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 7;
+
+BEGIN {
+ use_ok('Class::C3::XS');
+}
+
+=pod
+
+This example is take from: http://www.python.org/2.3/mro.html
+
+"My first example"
+class O: pass
+class F(O): pass
+class E(O): pass
+class D(O): pass
+class C(D,F): pass
+class B(D,E): pass
+class A(B,C): pass
+
+
+ 6
+ ---
+Level 3 | O | (more general)
+ / --- \
+ / | \ |
+ / | \ |
+ / | \ |
+ --- --- --- |
+Level 2 3 | D | 4| E | | F | 5 |
+ --- --- --- |
+ \ \ _ / | |
+ \ / \ _ | |
+ \ / \ | |
+ --- --- |
+Level 1 1 | B | | C | 2 |
+ --- --- |
+ \ / |
+ \ / \ /
+ ---
+Level 0 0 | A | (more specialized)
+ ---
+
+=cut
+
+{
+ package Test::O;
+ our @ISA = qw//;
+
+ package Test::F;
+ use base 'Test::O';
+
+ package Test::E;
+ use base 'Test::O';
+
+ package Test::D;
+ use base 'Test::O';
+
+ package Test::C;
+ use base ('Test::D', 'Test::F');
+
+ package Test::B;
+ use base ('Test::D', 'Test::E');
+
+ package Test::A;
+ use base ('Test::B', 'Test::C');
+}
+
+is_deeply(
+ [ Class::C3::XS::calculateMRO('Test::F') ],
+ [ qw(Test::F Test::O) ],
+ '... got the right MRO for Test::F');
+
+is_deeply(
+ [ Class::C3::XS::calculateMRO('Test::E') ],
+ [ qw(Test::E Test::O) ],
+ '... got the right MRO for Test::E');
+
+is_deeply(
+ [ Class::C3::XS::calculateMRO('Test::D') ],
+ [ qw(Test::D Test::O) ],
+ '... got the right MRO for Test::D');
+
+is_deeply(
+ [ Class::C3::XS::calculateMRO('Test::C') ],
+ [ qw(Test::C Test::D Test::F Test::O) ],
+ '... got the right MRO for Test::C');
+
+is_deeply(
+ [ Class::C3::XS::calculateMRO('Test::B') ],
+ [ qw(Test::B Test::D Test::E Test::O) ],
+ '... got the right MRO for Test::B');
+
+is_deeply(
+ [ Class::C3::XS::calculateMRO('Test::A') ],
+ [ qw(Test::A Test::B Test::C Test::D Test::E Test::F Test::O) ],
+ '... got the right MRO for Test::A');
+
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+
+BEGIN {
+ use_ok('Class::C3::XS');
+}
+
+=pod
+
+
+This example is take from: http://www.python.org/2.3/mro.html
+
+"My second example"
+class O: pass
+class F(O): pass
+class E(O): pass
+class D(O): pass
+class C(D,F): pass
+class B(E,D): pass
+class A(B,C): pass
+
+ 6
+ ---
+Level 3 | O |
+ / --- \
+ / | \
+ / | \
+ / | \
+ --- --- ---
+Level 2 2 | E | 4 | D | | F | 5
+ --- --- ---
+ \ / \ /
+ \ / \ /
+ \ / \ /
+ --- ---
+Level 1 1 | B | | C | 3
+ --- ---
+ \ /
+ \ /
+ ---
+Level 0 0 | A |
+ ---
+
+>>> A.mro()
+(<class '__main__.A'>, <class '__main__.B'>, <class '__main__.E'>,
+<class '__main__.C'>, <class '__main__.D'>, <class '__main__.F'>,
+<type 'object'>)
+
+=cut
+
+{
+ package Test::O;
+ our @ISA = qw//;
+
+ package Test::F;
+ use base 'Test::O';
+
+ package Test::E;
+ use base 'Test::O';
+
+ package Test::D;
+ use base 'Test::O';
+
+ package Test::C;
+ use base ('Test::D', 'Test::F');
+
+ package Test::B;
+ use base ('Test::E', 'Test::D');
+
+ package Test::A;
+ use base ('Test::B', 'Test::C');
+}
+
+is_deeply(
+ [ Class::C3::XS::calculateMRO('Test::A') ],
+ [ qw(Test::A Test::B Test::E Test::C Test::D Test::F Test::O) ],
+ '... got the right MRO for Test::A');
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+
+BEGIN {
+ use_ok('Class::C3::XS');
+}
+
+=pod
+
+example taken from: L<http://gauss.gwydiondylan.org/books/drm/drm_50.html>
+
+ Object
+ ^
+ |
+ LifeForm
+ ^ ^
+ / \
+ Sentient BiPedal
+ ^ ^
+ | |
+ Intelligent Humanoid
+ ^ ^
+ \ /
+ Vulcan
+
+ define class <sentient> (<life-form>) end class;
+ define class <bipedal> (<life-form>) end class;
+ define class <intelligent> (<sentient>) end class;
+ define class <humanoid> (<bipedal>) end class;
+ define class <vulcan> (<intelligent>, <humanoid>) end class;
+
+=cut
+
+{
+ package Object;
+ our @ISA = qw//;
+
+ package LifeForm;
+ use base 'Object';
+
+ package Sentient;
+ use base 'LifeForm';
+
+ package BiPedal;
+ use base 'LifeForm';
+
+ package Intelligent;
+ use base 'Sentient';
+
+ package Humanoid;
+ use base 'BiPedal';
+
+ package Vulcan;
+ use base ('Intelligent', 'Humanoid');
+}
+
+is_deeply(
+ [ Class::C3::XS::calculateMRO('Vulcan') ],
+ [ qw(Vulcan Intelligent Sentient Humanoid BiPedal LifeForm Object) ],
+ '... got the right MRO for the Vulcan Dylan Example');
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 3;
+
+BEGIN {
+ use_ok('Class::C3::XS');
+ use_ok('t::lib::F');
+}
+
+=pod
+
+From the parrot test t/pmc/object-meths.t
+
+ A B A E
+ \ / \ /
+ C D
+ \ /
+ \ /
+ F
+
+=cut
+
+is_deeply(
+ [ Class::C3::XS::calculateMRO('t::lib::F') ],
+ [ qw(t::lib::F t::lib::C t::lib::D t::lib::A t::lib::B t::lib::E) ],
+ '... got the right MRO for t::lib::F');
+
--- /dev/null
+package t::lib::A;
+our @ISA = qw//;
+1;
--- /dev/null
+package t::lib::B;
+our @ISA = qw//;
+1;
--- /dev/null
+package t::lib::C;
+use base ('t::lib::A', 't::lib::B');
+1;
--- /dev/null
+package t::lib::D;
+use base ('t::lib::A', 't::lib::E');
+1;
--- /dev/null
+package t::lib::E;
+our @ISA = qw//;
+1;
--- /dev/null
+package t::lib::F;
+use base ('t::lib::C', 't::lib::D');
+1;