use strict;
use warnings;
-use Test::More tests => 4;
+use Test::More tests => 2;
-BEGIN {
- use_ok('Class::C3');
- use_ok('Class::C3::next');
-}
+use Class::C3;
+use Class::C3::next;
if ($] > 5.009_004) {
ok ($Class::C3::C3_IN_CORE, 'C3 in core');
use strict;
use warnings;
-use Test::More tests => 11;
-
-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 => 10;
=pod
use strict;
use warnings;
-use Test::More tests => 15;
-
-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 => 14;
=pod
is(Test::A->C_or_E, 'Test::E', '... old method resolution has been restored');
is(Test::A->can('C_or_E')->(), 'Test::E', '... old can(method) resolution has been restored');
-
\ No newline at end of file
+
use strict;
use warnings;
-use Test::More tests => 8;
-
-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
use strict;
use warnings;
-use Test::More tests => 2;
-
-BEGIN {
- use lib 'opt', '../opt', '..';
- use_ok('c3');
-}
+use Test::More tests => 1;
=pod
{
package Object;
- use c3;
+ use Class::C3;
package LifeForm;
- use c3;
+ use Class::C3;
use base 'Object';
package Sentient;
- use c3;
+ use Class::C3;
use base 'LifeForm';
package BiPedal;
- use c3;
+ use Class::C3;
use base 'LifeForm';
package Intelligent;
- use c3;
+ use Class::C3;
use base 'Sentient';
package Humanoid;
- use c3;
+ use Class::C3;
use base 'BiPedal';
package Vulcan;
- use c3;
+ use Class::C3;
use base ('Intelligent', 'Humanoid');
}
Class::C3::initialize();
is_deeply(
- [ c3::calculateMRO('Vulcan') ],
+ [ Class::C3::calculateMRO('Vulcan') ],
[ qw(Vulcan Intelligent Sentient Humanoid BiPedal LifeForm Object) ],
- '... got the right MRO for the Vulcan Dylan Example');
\ No newline at end of file
+ '... got the right MRO for the Vulcan Dylan Example');
use strict;
use warnings;
-use Test::More tests => 3;
+use Test::More tests => 2;
BEGIN {
- use lib 'opt', '../opt', '..';
- use_ok('c3');
- use_ok('t::lib::F');
+ use_ok('t::lib::F');
}
=pod
Class::C3::initialize();
is_deeply(
- [ c3::calculateMRO('t::lib::F') ],
+ [ Class::C3::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');
use strict;
use warnings;
-use Test::More tests => 3;
-
-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 => 2;
=pod
use strict;
use warnings;
-use Test::More tests => 2;
-
-BEGIN {
- use_ok('Class::C3');
-}
+use Test::More tests => 1;
=pod
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 => 4;
=pod
use strict;
use warnings;
-use Test::More tests => 9;
-
-BEGIN {
- use_ok('Class::C3');
-}
+use Test::More tests => 8;
{
package BaseTest;
use strict;
use warnings;
-use Test::More tests => 12;
-
-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 => 11;
=pod
use strict;
use warnings;
-use Test::More tests => 2;
-
-BEGIN {
- use_ok('Class::C3');
-}
+use Test::More tests => 1;
=pod
use strict;
use warnings;
-use Test::More tests => 4;
-
-BEGIN {
- use_ok('Class::C3');
-}
+use Test::More tests => 3;
{
package BaseTest;
use strict;
use warnings;
-use Test::More tests => 6;
-
-BEGIN {
- use lib 'opt', '../opt', '..';
- use_ok('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 => 5;
=pod
{
package Diamond_A;
- use c3;
+ use Class::C3;
sub hello { 'Diamond_A::hello' }
sub foo { 'Diamond_A::foo' }
}
{
package Diamond_B;
use base 'Diamond_A';
- use c3;
+ use Class::C3;
sub foo { 'Diamond_B::foo => ' . (shift)->next::method() }
}
{
package Diamond_C;
- use c3;
+ use Class::C3;
use base 'Diamond_A';
sub hello { 'Diamond_C::hello => ' . (shift)->next::method() }
{
package Diamond_D;
use base ('Diamond_B', 'Diamond_C');
- use c3;
+ use Class::C3;
sub foo { 'Diamond_D::foo => ' . (shift)->next::method() }
}
use strict;
use warnings;
-use Test::More tests => 11;
-
-BEGIN {
- use lib 'opt', '../opt', '..';
- use_ok('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 => 10;
=pod
{
package Diamond_A;
- use c3;
+ use Class::C3;
sub bar { 'Diamond_A::bar' }
sub baz { 'Diamond_A::baz' }
}
{
package Diamond_B;
use base 'Diamond_A';
- use c3;
+ use Class::C3;
sub baz { 'Diamond_B::baz => ' . (shift)->next::method() }
}
{
package Diamond_C;
- use c3;
+ use Class::C3;
use base 'Diamond_A';
sub foo { 'Diamond_C::foo' }
sub buz { 'Diamond_C::buz' }
{
package Diamond_D;
use base ('Diamond_B', 'Diamond_C');
- use c3;
+ use Class::C3;
sub foo { 'Diamond_D::foo => ' . (shift)->next::method() }
sub bar { 'Diamond_D::bar => ' . (shift)->next::method() }
sub buz { 'Diamond_D::buz => ' . (shift)->baz() }
use strict;
use warnings;
-use Test::More tests => 12;
-
-BEGIN {
- use_ok('Class::C3');
-}
+use Test::More tests => 11;
{
eval { $baz->bar() };
ok($@, '... calling bar() with next::method failed') || diag $@;
}
-}
\ No newline at end of file
+}
use strict;
use warnings;
-use Test::More tests => 2;
-
-BEGIN {
- use lib 'opt', '../opt', '..';
- use_ok('c3');
-}
+use Test::More tests => 1;
=pod
{
package A;
- use c3;
+ use Class::C3;
sub foo {
die 'A::foo died';
{
package B;
use base 'A';
- use c3;
+ use Class::C3;
sub foo {
eval {
use strict;
use warnings;
-use Test::More tests => 3;
-
-BEGIN {
- use lib 'opt', '../opt', '../blib/lib';
- use_ok('c3');
-}
+use Test::More tests => 2;
=pod
{
package A;
- use c3;
+ use Class::C3;
sub foo {
return 'A::foo';
{
package B;
use base 'A';
- use c3;
+ use Class::C3;
sub foo {
my $code = sub {
use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More tests => 4;
-BEGIN { use_ok('Class::C3') }
+use Class::C3;
{
package Proxy;
package t::lib::A;
-use c3;
-1;
\ No newline at end of file
+use Class::C3;
+1;
package t::lib::B;
-use c3;
-1;
\ No newline at end of file
+use Class::C3;
+1;
package t::lib::C;
-use c3;
+use Class::C3;
use base ('t::lib::A', 't::lib::B');
-1;
\ No newline at end of file
+1;
package t::lib::D;
-use c3;
+use Class::C3;
use base ('t::lib::A', 't::lib::E');
-1;
\ No newline at end of file
+1;
package t::lib::E;
-use c3;
-1;
\ No newline at end of file
+use Class::C3;
+1;
package t::lib::F;
-use c3;
+use Class::C3;
use base ('t::lib::C', 't::lib::D');
-1;
\ No newline at end of file
+1;
plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
all_pod_coverage_ok({ also_private => [ qr/removeChildAt/ ] });
-}
\ No newline at end of file
+}