From: Graham Knop Date: Fri, 17 Jan 2014 02:32:03 +0000 (-0500) Subject: remove extraneous garbage from tests X-Git-Tag: 0.26~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef29cd706106f8ab6e7b0c25e8dc832bb337c5ed;p=gitmo%2FClass-C3.git remove extraneous garbage from tests --- diff --git a/t/00_load.t b/t/00_load.t index 7201dac..b8c9fd3 100644 --- a/t/00_load.t +++ b/t/00_load.t @@ -3,12 +3,10 @@ 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'); diff --git a/t/01_MRO.t b/t/01_MRO.t index 5865612..61bc5fc 100644 --- a/t/01_MRO.t +++ b/t/01_MRO.t @@ -3,14 +3,7 @@ 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 diff --git a/t/02_MRO.t b/t/02_MRO.t index d4bf02c..eb989d4 100644 --- a/t/02_MRO.t +++ b/t/02_MRO.t @@ -3,14 +3,7 @@ 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 @@ -133,4 +126,4 @@ is(Test::A->can('C_or_D')->(), 'Test::D', '... old can(method) resolution has b 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 + diff --git a/t/03_MRO.t b/t/03_MRO.t index a13294f..182926c 100644 --- a/t/03_MRO.t +++ b/t/03_MRO.t @@ -3,14 +3,7 @@ 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 diff --git a/t/04_MRO.t b/t/04_MRO.t index 1e9bbba..c7048df 100644 --- a/t/04_MRO.t +++ b/t/04_MRO.t @@ -3,12 +3,7 @@ use strict; use warnings; -use Test::More tests => 2; - -BEGIN { - use lib 'opt', '../opt', '..'; - use_ok('c3'); -} +use Test::More tests => 1; =pod @@ -38,36 +33,36 @@ example taken from: L { 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'); diff --git a/t/05_MRO.t b/t/05_MRO.t index d3c6b77..2faeb6d 100644 --- a/t/05_MRO.t +++ b/t/05_MRO.t @@ -3,12 +3,10 @@ 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 @@ -27,7 +25,7 @@ From the parrot test t/pmc/object-meths.t 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'); diff --git a/t/06_MRO.t b/t/06_MRO.t index de8db0f..f1dfc6d 100644 --- a/t/06_MRO.t +++ b/t/06_MRO.t @@ -3,14 +3,7 @@ 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 diff --git a/t/10_Inconsistent_hierarchy.t b/t/10_Inconsistent_hierarchy.t index d36e42d..ccf7e55 100644 --- a/t/10_Inconsistent_hierarchy.t +++ b/t/10_Inconsistent_hierarchy.t @@ -3,11 +3,7 @@ use strict; use warnings; -use Test::More tests => 2; - -BEGIN { - use_ok('Class::C3'); -} +use Test::More tests => 1; =pod diff --git a/t/20_reinitialize.t b/t/20_reinitialize.t index 0912cb4..e4dd879 100644 --- a/t/20_reinitialize.t +++ b/t/20_reinitialize.t @@ -3,14 +3,7 @@ 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 diff --git a/t/21_C3_with_overload.t b/t/21_C3_with_overload.t index 80b45a8..136eefd 100644 --- a/t/21_C3_with_overload.t +++ b/t/21_C3_with_overload.t @@ -3,11 +3,7 @@ use strict; use warnings; -use Test::More tests => 9; - -BEGIN { - use_ok('Class::C3'); -} +use Test::More tests => 8; { package BaseTest; diff --git a/t/22_uninitialize.t b/t/22_uninitialize.t index 4ffaf50..ccf6c97 100644 --- a/t/22_uninitialize.t +++ b/t/22_uninitialize.t @@ -3,14 +3,7 @@ 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 diff --git a/t/23_multi_init.t b/t/23_multi_init.t index ebe9a72..fdbeb5d 100644 --- a/t/23_multi_init.t +++ b/t/23_multi_init.t @@ -3,11 +3,7 @@ use strict; use warnings; -use Test::More tests => 2; - -BEGIN { - use_ok('Class::C3'); -} +use Test::More tests => 1; =pod diff --git a/t/24_more_overload.t b/t/24_more_overload.t index d02c8de..e2c1a79 100644 --- a/t/24_more_overload.t +++ b/t/24_more_overload.t @@ -3,11 +3,7 @@ use strict; use warnings; -use Test::More tests => 4; - -BEGIN { - use_ok('Class::C3'); -} +use Test::More tests => 3; { package BaseTest; diff --git a/t/30_next_method.t b/t/30_next_method.t index db724c9..0e4bf32 100644 --- a/t/30_next_method.t +++ b/t/30_next_method.t @@ -3,15 +3,7 @@ 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 @@ -27,19 +19,19 @@ This tests the classic diamond inheritence pattern. { 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() } @@ -48,7 +40,7 @@ This tests the classic diamond inheritence pattern. { package Diamond_D; use base ('Diamond_B', 'Diamond_C'); - use c3; + use Class::C3; sub foo { 'Diamond_D::foo => ' . (shift)->next::method() } } diff --git a/t/31_next_method_skip.t b/t/31_next_method_skip.t index 7af8035..0b166ce 100644 --- a/t/31_next_method_skip.t +++ b/t/31_next_method_skip.t @@ -3,15 +3,7 @@ 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 @@ -27,19 +19,19 @@ This tests the classic diamond inheritence pattern. { 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' } @@ -50,7 +42,7 @@ This tests the classic diamond inheritence pattern. { 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() } diff --git a/t/32_next_method_edge_cases.t b/t/32_next_method_edge_cases.t index 5af7004..1f312ee 100644 --- a/t/32_next_method_edge_cases.t +++ b/t/32_next_method_edge_cases.t @@ -3,11 +3,7 @@ use strict; use warnings; -use Test::More tests => 12; - -BEGIN { - use_ok('Class::C3'); -} +use Test::More tests => 11; { @@ -87,4 +83,4 @@ BEGIN { eval { $baz->bar() }; ok($@, '... calling bar() with next::method failed') || diag $@; } -} \ No newline at end of file +} diff --git a/t/34_next_method_in_eval.t b/t/34_next_method_in_eval.t index f782cd6..e95a169 100644 --- a/t/34_next_method_in_eval.t +++ b/t/34_next_method_in_eval.t @@ -3,12 +3,7 @@ use strict; use warnings; -use Test::More tests => 2; - -BEGIN { - use lib 'opt', '../opt', '..'; - use_ok('c3'); -} +use Test::More tests => 1; =pod @@ -18,7 +13,7 @@ This tests the use of an eval{} block to wrap a next::method call. { package A; - use c3; + use Class::C3; sub foo { die 'A::foo died'; @@ -29,7 +24,7 @@ This tests the use of an eval{} block to wrap a next::method call. { package B; use base 'A'; - use c3; + use Class::C3; sub foo { eval { diff --git a/t/35_next_method_in_anon.t b/t/35_next_method_in_anon.t index 67342b5..0e58dac 100644 --- a/t/35_next_method_in_anon.t +++ b/t/35_next_method_in_anon.t @@ -3,12 +3,7 @@ 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 @@ -19,7 +14,7 @@ anonymous subroutine. { package A; - use c3; + use Class::C3; sub foo { return 'A::foo'; @@ -33,7 +28,7 @@ anonymous subroutine. { package B; use base 'A'; - use c3; + use Class::C3; sub foo { my $code = sub { diff --git a/t/36_next_goto.t b/t/36_next_goto.t index e4ea21b..b8658f9 100644 --- a/t/36_next_goto.t +++ b/t/36_next_goto.t @@ -3,9 +3,9 @@ use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 4; -BEGIN { use_ok('Class::C3') } +use Class::C3; { package Proxy; diff --git a/t/lib/A.pm b/t/lib/A.pm index 74acfec..b1b188b 100644 --- a/t/lib/A.pm +++ b/t/lib/A.pm @@ -1,3 +1,3 @@ package t::lib::A; -use c3; -1; \ No newline at end of file +use Class::C3; +1; diff --git a/t/lib/B.pm b/t/lib/B.pm index 8d5d80f..e226e9a 100644 --- a/t/lib/B.pm +++ b/t/lib/B.pm @@ -1,3 +1,3 @@ package t::lib::B; -use c3; -1; \ No newline at end of file +use Class::C3; +1; diff --git a/t/lib/C.pm b/t/lib/C.pm index 608ea0c..e2aa113 100644 --- a/t/lib/C.pm +++ b/t/lib/C.pm @@ -1,4 +1,4 @@ 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; diff --git a/t/lib/D.pm b/t/lib/D.pm index 4ccb3de..ed386f6 100644 --- a/t/lib/D.pm +++ b/t/lib/D.pm @@ -1,4 +1,4 @@ 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; diff --git a/t/lib/E.pm b/t/lib/E.pm index 4cb7b71..3a58814 100644 --- a/t/lib/E.pm +++ b/t/lib/E.pm @@ -1,3 +1,3 @@ package t::lib::E; -use c3; -1; \ No newline at end of file +use Class::C3; +1; diff --git a/t/lib/F.pm b/t/lib/F.pm index a53c2d7..34ba923 100644 --- a/t/lib/F.pm +++ b/t/lib/F.pm @@ -1,4 +1,4 @@ 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; diff --git a/t/pod_coverage.t b/t/pod_coverage.t index 84632f2..1d591ed 100644 --- a/t/pod_coverage.t +++ b/t/pod_coverage.t @@ -10,4 +10,4 @@ BEGIN { 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 +}