use strict;
use warnings;
-use Test::More tests => 7;
+use Test::More;
=pod
-This tests that Class::MOP works correctly
-with Class::C3 and it's somewhat insane
+This tests that Class::MOP works correctly
+with Class::C3 and it's somewhat insane
approach to method resolution.
=cut
-BEGIN {use Class::MOP;
-}
+use Class::MOP;
{
package Diamond_A;
use mro 'c3';
use metaclass; # everyone will just inherit this now :)
-
+
sub hello { 'Diamond_A::hello' }
}
{
package Diamond_B;
- use mro 'c3';
+ use mro 'c3';
use base 'Diamond_A';
}
{
package Diamond_C;
use mro 'c3';
- use base 'Diamond_A';
-
+ use base 'Diamond_A';
+
sub hello { 'Diamond_C::hello' }
}
{
package Diamond_D;
- use mro 'c3';
+ use mro 'c3';
use base ('Diamond_B', 'Diamond_C');
}
-# we have to manually initialize
-# Class::C3 since we potentially
+# we have to manually initialize
+# Class::C3 since we potentially
# skip this test if it is not present
Class::C3::initialize();
ok(defined &Diamond_B::hello, '... B does have an alias to the method hello');
ok(defined &Diamond_D::hello, '... D does have an alias to the method hello');
}
+
+done_testing;