From: Rafael Garcia-Suarez Date: Sat, 21 Apr 2007 09:08:04 +0000 (+0000) Subject: Completely remove Test::More from the MRO tests, by Brandon Black X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c94dd5be9196e7fc999830ac8069b03bb8f510be;p=p5sagit%2Fp5-mst-13.2.git Completely remove Test::More from the MRO tests, by Brandon Black p4raw-id: //depot/perl@31004 --- diff --git a/t/mro/basic.t b/t/mro/basic.t index 303708e..3f1d1cf 100644 --- a/t/mro/basic.t +++ b/t/mro/basic.t @@ -3,16 +3,7 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} - -use Test::More; - -plan tests => 8; +require q(./test.pl); plan(tests => 8); { package MRO_A; @@ -30,19 +21,22 @@ plan tests => 8; } is(mro::get_mro('MRO_F'), 'dfs'); -is_deeply(mro::get_linear_isa('MRO_F'), +ok(eq_array( + mro::get_linear_isa('MRO_F'), [qw/MRO_F MRO_D MRO_A MRO_B MRO_C MRO_E/] -); +)); mro::set_mro('MRO_F', 'c3'); is(mro::get_mro('MRO_F'), 'c3'); -is_deeply(mro::get_linear_isa('MRO_F'), +ok(eq_array( + mro::get_linear_isa('MRO_F'), [qw/MRO_F MRO_D MRO_E MRO_A MRO_B MRO_C/] -); +)); my @isarev = sort { $a cmp $b } mro::get_isarev('MRO_B'); -is_deeply(\@isarev, +ok(eq_array( + \@isarev, [qw/MRO_D MRO_E MRO_F/] -); +)); ok(!mro::is_universal('MRO_B')); diff --git a/t/mro/basic_01_c3.t b/t/mro/basic_01_c3.t index 95d3479..2bcb225 100644 --- a/t/mro/basic_01_c3.t +++ b/t/mro/basic_01_c3.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 4; +require q(./test.pl); plan(tests => 4); =pod @@ -43,10 +37,10 @@ This tests the classic diamond inheritence pattern. use mro 'c3'; } -is_deeply( +ok(eq_array( mro::get_linear_isa('Diamond_D'), - [ qw(Diamond_D Diamond_B Diamond_C Diamond_A) ], - '... got the right MRO for Diamond_D'); + [ qw(Diamond_D Diamond_B Diamond_C Diamond_A) ] +), '... got the right MRO for Diamond_D'); is(Diamond_D->hello, 'Diamond_C::hello', '... method resolved itself as expected'); is(Diamond_D->can('hello')->(), 'Diamond_C::hello', '... can(method) resolved itself as expected'); diff --git a/t/mro/basic_01_dfs.t b/t/mro/basic_01_dfs.t index 11c15a2..dfa6d3b 100644 --- a/t/mro/basic_01_dfs.t +++ b/t/mro/basic_01_dfs.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 4; +require q(./test.pl); plan(tests => 4); =pod @@ -43,10 +37,10 @@ This tests the classic diamond inheritence pattern. use mro 'dfs'; } -is_deeply( +ok(eq_array( mro::get_linear_isa('Diamond_D'), - [ qw(Diamond_D Diamond_B Diamond_A Diamond_C) ], - '... got the right MRO for Diamond_D'); + [ qw(Diamond_D Diamond_B Diamond_A Diamond_C) ] +), '... got the right MRO for Diamond_D'); is(Diamond_D->hello, 'Diamond_A::hello', '... method resolved itself as expected'); is(Diamond_D->can('hello')->(), 'Diamond_A::hello', '... can(method) resolved itself as expected'); diff --git a/t/mro/basic_02_c3.t b/t/mro/basic_02_c3.t index 86fbc32..b2c3ce4 100644 --- a/t/mro/basic_02_c3.t +++ b/t/mro/basic_02_c3.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 10; +require q(./test.pl); plan(tests => 10); =pod @@ -85,35 +79,35 @@ Level 0 0 | A | (more specialized) use mro 'c3'; } -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::F'), - [ qw(Test::F Test::O) ], - '... got the right MRO for Test::F'); + [ qw(Test::F Test::O) ] +), '... got the right MRO for Test::F'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::E'), - [ qw(Test::E Test::O) ], - '... got the right MRO for Test::E'); + [ qw(Test::E Test::O) ] +), '... got the right MRO for Test::E'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::D'), - [ qw(Test::D Test::O) ], - '... got the right MRO for Test::D'); + [ qw(Test::D Test::O) ] +), '... got the right MRO for Test::D'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::C'), - [ qw(Test::C Test::D Test::F Test::O) ], - '... got the right MRO for Test::C'); + [ qw(Test::C Test::D Test::F Test::O) ] +), '... got the right MRO for Test::C'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::B'), - [ qw(Test::B Test::D Test::E Test::O) ], - '... got the right MRO for Test::B'); + [ qw(Test::B Test::D Test::E Test::O) ] +), '... got the right MRO for Test::B'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::A'), - [ qw(Test::A Test::B Test::C Test::D Test::E Test::F Test::O) ], - '... got the right MRO for Test::A'); + [ qw(Test::A Test::B Test::C Test::D Test::E Test::F Test::O) ] +), '... got the right MRO for Test::A'); is(Test::A->C_or_D, 'Test::C', '... got the expected method output'); is(Test::A->can('C_or_D')->(), 'Test::C', '... can got the expected method output'); diff --git a/t/mro/basic_02_dfs.t b/t/mro/basic_02_dfs.t index bbce6a0..a4bad46 100644 --- a/t/mro/basic_02_dfs.t +++ b/t/mro/basic_02_dfs.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 10; +require q(./test.pl); plan(tests => 10); =pod @@ -85,35 +79,35 @@ Level 0 0 | A | (more specialized) use mro 'dfs'; } -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::F'), - [ qw(Test::F Test::O) ], - '... got the right MRO for Test::F'); + [ qw(Test::F Test::O) ] +), '... got the right MRO for Test::F'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::E'), - [ qw(Test::E Test::O) ], - '... got the right MRO for Test::E'); + [ qw(Test::E Test::O) ] +), '... got the right MRO for Test::E'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::D'), - [ qw(Test::D Test::O) ], - '... got the right MRO for Test::D'); + [ qw(Test::D Test::O) ] +), '... got the right MRO for Test::D'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::C'), - [ qw(Test::C Test::D Test::O Test::F) ], - '... got the right MRO for Test::C'); + [ qw(Test::C Test::D Test::O Test::F) ] +), '... got the right MRO for Test::C'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::B'), - [ qw(Test::B Test::D Test::O Test::E) ], - '... got the right MRO for Test::B'); + [ qw(Test::B Test::D Test::O Test::E) ] +), '... got the right MRO for Test::B'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::A'), - [ qw(Test::A Test::B Test::D Test::O Test::E Test::C Test::F) ], - '... got the right MRO for Test::A'); + [ qw(Test::A Test::B Test::D Test::O Test::E Test::C Test::F) ] +), '... got the right MRO for Test::A'); is(Test::A->C_or_D, 'Test::D', '... got the expected method output'); is(Test::A->can('C_or_D')->(), 'Test::D', '... can got the expected method output'); diff --git a/t/mro/basic_03_c3.t b/t/mro/basic_03_c3.t index 08dfea8..f6606f6 100644 --- a/t/mro/basic_03_c3.t +++ b/t/mro/basic_03_c3.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 4; +require q(./test.pl); plan(tests => 4); =pod @@ -92,10 +86,10 @@ Level 0 0 | A | use mro 'c3'; } -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::A'), - [ qw(Test::A Test::B Test::E Test::C Test::D Test::F Test::O) ], - '... got the right MRO for Test::A'); + [ qw(Test::A Test::B Test::E Test::C Test::D Test::F Test::O) ] +), '... got the right MRO for Test::A'); is(Test::A->O_or_D, 'Test::D', '... got the right method dispatch'); is(Test::A->O_or_F, 'Test::F', '... got the right method dispatch'); diff --git a/t/mro/basic_03_dfs.t b/t/mro/basic_03_dfs.t index d2af5b2..5794d8f 100644 --- a/t/mro/basic_03_dfs.t +++ b/t/mro/basic_03_dfs.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 4; +require q(./test.pl); plan(tests => 4); =pod @@ -92,10 +86,10 @@ Level 0 0 | A | use mro 'dfs'; } -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::A'), - [ qw(Test::A Test::B Test::E Test::O Test::D Test::C Test::F) ], - '... got the right MRO for Test::A'); + [ qw(Test::A Test::B Test::E Test::O Test::D Test::C Test::F) ] +), '... got the right MRO for Test::A'); is(Test::A->O_or_D, 'Test::O', '... got the right method dispatch'); is(Test::A->O_or_F, 'Test::O', '... got the right method dispatch'); diff --git a/t/mro/basic_04_c3.t b/t/mro/basic_04_c3.t index f7e92ec..dbfc883 100644 --- a/t/mro/basic_04_c3.t +++ b/t/mro/basic_04_c3.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 1; +require q(./test.pl); plan(tests => 1); =pod @@ -33,8 +27,8 @@ From the parrot test t/pmc/object-meths.t package t::lib::F; use mro 'c3'; use base ('t::lib::C', 't::lib::D'); } -is_deeply( +ok(eq_array( mro::get_linear_isa('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'); + [ 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/mro/basic_04_dfs.t b/t/mro/basic_04_dfs.t index bb6a352..e49f4f4 100644 --- a/t/mro/basic_04_dfs.t +++ b/t/mro/basic_04_dfs.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 1; +require q(./test.pl); plan(tests => 1); =pod @@ -33,8 +27,8 @@ From the parrot test t/pmc/object-meths.t package t::lib::F; use mro 'dfs'; use base ('t::lib::C', 't::lib::D'); } -is_deeply( +ok(eq_array( mro::get_linear_isa('t::lib::F'), - [ qw(t::lib::F t::lib::C t::lib::A t::lib::B t::lib::D t::lib::E) ], - '... got the right MRO for t::lib::F'); + [ qw(t::lib::F t::lib::C t::lib::A t::lib::B t::lib::D t::lib::E) ] +), '... got the right MRO for t::lib::F'); diff --git a/t/mro/basic_05_c3.t b/t/mro/basic_05_c3.t index 91f2e35..1558585 100644 --- a/t/mro/basic_05_c3.t +++ b/t/mro/basic_05_c3.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 2; +require q(./test.pl); plan(tests => 2); =pod @@ -51,10 +45,10 @@ while building DBIx::Class. Thanks Matt!!!! sub foo { 'Diamond_D::foo => ' . (shift)->SUPER::foo } } -is_deeply( +ok(eq_array( mro::get_linear_isa('Diamond_D'), - [ qw(Diamond_D Diamond_C Diamond_B Diamond_A) ], - '... got the right MRO for Diamond_D'); + [ qw(Diamond_D Diamond_C Diamond_B Diamond_A) ] +), '... got the right MRO for Diamond_D'); is(Diamond_D->foo, 'Diamond_D::foo => Diamond_B::foo => Diamond_A::foo', diff --git a/t/mro/basic_05_dfs.t b/t/mro/basic_05_dfs.t index 187a640..0fee5c5 100644 --- a/t/mro/basic_05_dfs.t +++ b/t/mro/basic_05_dfs.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 2; +require q(./test.pl); plan(tests => 2); =pod @@ -51,10 +45,10 @@ while building DBIx::Class. Thanks Matt!!!! sub foo { 'Diamond_D::foo => ' . (shift)->SUPER::foo } } -is_deeply( +ok(eq_array( mro::get_linear_isa('Diamond_D'), - [ qw(Diamond_D Diamond_C Diamond_A Diamond_B) ], - '... got the right MRO for Diamond_D'); + [ qw(Diamond_D Diamond_C Diamond_A Diamond_B) ] +), '... got the right MRO for Diamond_D'); is(Diamond_D->foo, 'Diamond_D::foo => Diamond_A::foo', diff --git a/t/mro/complex_c3.t b/t/mro/complex_c3.t index 72c9c02..9d8e18e 100644 --- a/t/mro/complex_c3.t +++ b/t/mro/complex_c3.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 12; +require q(./test.pl); plan(tests => 12); =pod @@ -90,59 +84,59 @@ KJIHGFEDABC sub testmeth { shift->next::method } } -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::A'), - [ qw(Test::A) ], - '... got the right C3 merge order for Test::A'); + [ qw(Test::A) ] +), '... got the right C3 merge order for Test::A'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::B'), - [ qw(Test::B) ], - '... got the right C3 merge order for Test::B'); + [ qw(Test::B) ] +), '... got the right C3 merge order for Test::B'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::C'), - [ qw(Test::C) ], - '... got the right C3 merge order for Test::C'); + [ qw(Test::C) ] +), '... got the right C3 merge order for Test::C'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::D'), - [ qw(Test::D Test::A Test::B Test::C) ], - '... got the right C3 merge order for Test::D'); + [ qw(Test::D Test::A Test::B Test::C) ] +), '... got the right C3 merge order for Test::D'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::E'), - [ qw(Test::E Test::D Test::A Test::B Test::C) ], - '... got the right C3 merge order for Test::E'); + [ qw(Test::E Test::D Test::A Test::B Test::C) ] +), '... got the right C3 merge order for Test::E'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::F'), - [ qw(Test::F Test::E Test::D Test::A Test::B Test::C) ], - '... got the right C3 merge order for Test::F'); + [ qw(Test::F Test::E Test::D Test::A Test::B Test::C) ] +), '... got the right C3 merge order for Test::F'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::G'), - [ qw(Test::G Test::D Test::A Test::B Test::C) ], - '... got the right C3 merge order for Test::G'); + [ qw(Test::G Test::D Test::A Test::B Test::C) ] +), '... got the right C3 merge order for Test::G'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::H'), - [ qw(Test::H Test::G Test::D Test::A Test::B Test::C) ], - '... got the right C3 merge order for Test::H'); + [ qw(Test::H Test::G Test::D Test::A Test::B Test::C) ] +), '... got the right C3 merge order for Test::H'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::I'), - [ qw(Test::I Test::H Test::G Test::F Test::E Test::D Test::A Test::B Test::C) ], - '... got the right C3 merge order for Test::I'); + [ qw(Test::I Test::H Test::G Test::F Test::E Test::D Test::A Test::B Test::C) ] +), '... got the right C3 merge order for Test::I'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::J'), - [ qw(Test::J Test::F Test::E Test::D Test::A Test::B Test::C) ], - '... got the right C3 merge order for Test::J'); + [ qw(Test::J Test::F Test::E Test::D Test::A Test::B Test::C) ] +), '... got the right C3 merge order for Test::J'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::K'), - [ qw(Test::K Test::J Test::I Test::H Test::G Test::F Test::E Test::D Test::A Test::B Test::C) ], - '... got the right C3 merge order for Test::K'); + [ qw(Test::K Test::J Test::I Test::H Test::G Test::F Test::E Test::D Test::A Test::B Test::C) ] +), '... got the right C3 merge order for Test::K'); is(Test::K->testmeth(), "right", 'next::method working ok'); diff --git a/t/mro/complex_dfs.t b/t/mro/complex_dfs.t index d864555..905ac2d 100644 --- a/t/mro/complex_dfs.t +++ b/t/mro/complex_dfs.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 11; +require q(./test.pl); plan(tests => 11); =pod @@ -87,57 +81,57 @@ KJIHGFEDABC use base qw/Test::J Test::I/; } -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::A'), - [ qw(Test::A) ], - '... got the right DFS merge order for Test::A'); + [ qw(Test::A) ] +), '... got the right DFS merge order for Test::A'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::B'), - [ qw(Test::B) ], - '... got the right DFS merge order for Test::B'); + [ qw(Test::B) ] +), '... got the right DFS merge order for Test::B'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::C'), - [ qw(Test::C) ], - '... got the right DFS merge order for Test::C'); + [ qw(Test::C) ] +), '... got the right DFS merge order for Test::C'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::D'), - [ qw(Test::D Test::A Test::B Test::C) ], - '... got the right DFS merge order for Test::D'); + [ qw(Test::D Test::A Test::B Test::C) ] +), '... got the right DFS merge order for Test::D'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::E'), - [ qw(Test::E Test::D Test::A Test::B Test::C) ], - '... got the right DFS merge order for Test::E'); + [ qw(Test::E Test::D Test::A Test::B Test::C) ] +), '... got the right DFS merge order for Test::E'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::F'), - [ qw(Test::F Test::E Test::D Test::A Test::B Test::C) ], - '... got the right DFS merge order for Test::F'); + [ qw(Test::F Test::E Test::D Test::A Test::B Test::C) ] +), '... got the right DFS merge order for Test::F'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::G'), - [ qw(Test::G Test::D Test::A Test::B Test::C) ], - '... got the right DFS merge order for Test::G'); + [ qw(Test::G Test::D Test::A Test::B Test::C) ] +), '... got the right DFS merge order for Test::G'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::H'), - [ qw(Test::H Test::G Test::D Test::A Test::B Test::C) ], - '... got the right DFS merge order for Test::H'); + [ qw(Test::H Test::G Test::D Test::A Test::B Test::C) ] +), '... got the right DFS merge order for Test::H'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::I'), - [ qw(Test::I Test::H Test::G Test::D Test::A Test::B Test::C Test::F Test::E) ], - '... got the right DFS merge order for Test::I'); + [ qw(Test::I Test::H Test::G Test::D Test::A Test::B Test::C Test::F Test::E) ] +), '... got the right DFS merge order for Test::I'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::J'), - [ qw(Test::J Test::F Test::E Test::D Test::A Test::B Test::C) ], - '... got the right DFS merge order for Test::J'); + [ qw(Test::J Test::F Test::E Test::D Test::A Test::B Test::C) ] +), '... got the right DFS merge order for Test::J'); -is_deeply( +ok(eq_array( mro::get_linear_isa('Test::K'), - [ qw(Test::K Test::J Test::F Test::E Test::D Test::A Test::B Test::C Test::I Test::H Test::G) ], - '... got the right DFS merge order for Test::K'); + [ qw(Test::K Test::J Test::F Test::E Test::D Test::A Test::B Test::C Test::I Test::H Test::G) ] +), '... got the right DFS merge order for Test::K'); diff --git a/t/mro/dbic_c3.t b/t/mro/dbic_c3.t index a59f334..51d8784 100644 --- a/t/mro/dbic_c3.t +++ b/t/mro/dbic_c3.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 1; +require q(./test.pl); plan(tests => 1); =pod @@ -96,7 +90,7 @@ The xx:: prefixes are just to be sure these bogus declarations never stomp on re package xx::DBIx::Class::Relationship::CascadeActions; our @ISA = (); use mro 'c3'; } -is_deeply( +ok(eq_array( mro::get_linear_isa('xx::DBIx::Class::Core'), [qw/ xx::DBIx::Class::Core @@ -121,5 +115,5 @@ is_deeply( xx::DBIx::Class xx::DBIx::Class::Componentised xx::Class::Data::Accessor - /], - '... got the right C3 merge order for xx::DBIx::Class::Core'); + /] +), '... got the right C3 merge order for xx::DBIx::Class::Core'); diff --git a/t/mro/dbic_dfs.t b/t/mro/dbic_dfs.t index f823147..6d5ff7d 100644 --- a/t/mro/dbic_dfs.t +++ b/t/mro/dbic_dfs.t @@ -2,14 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 1; +require q(./test.pl); plan(tests => 1); =pod @@ -96,7 +90,7 @@ The xx:: prefixes are just to be sure these bogus declarations never stomp on re package xx::DBIx::Class::Relationship::CascadeActions; our @ISA = (); use mro 'dfs'; } -is_deeply( +ok(eq_array( mro::get_linear_isa('xx::DBIx::Class::Core'), [qw/ xx::DBIx::Class::Core @@ -121,5 +115,5 @@ is_deeply( xx::DBIx::Class::ResultSourceProxy::Table xx::DBIx::Class::AccessorGroup xx::DBIx::Class::ResultSourceProxy - /], - '... got the right DFS merge order for xx::DBIx::Class::Core'); + /] +), '... got the right DFS merge order for xx::DBIx::Class::Core'); diff --git a/t/mro/next_method.t b/t/mro/next_method.t index b0bb789..ffeda1e 100644 --- a/t/mro/next_method.t +++ b/t/mro/next_method.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 5; +require q(./test.pl); plan(tests => 5); =pod @@ -45,10 +45,10 @@ This tests the classic diamond inheritence pattern. sub foo { 'Diamond_D::foo => ' . (shift)->next::method() } } -is_deeply( +ok(eq_array( mro::get_linear_isa('Diamond_D'), - [ qw(Diamond_D Diamond_B Diamond_C Diamond_A) ], - '... got the right MRO for Diamond_D'); + [ qw(Diamond_D Diamond_B Diamond_C Diamond_A) ] +), '... got the right MRO for Diamond_D'); is(Diamond_D->hello, 'Diamond_C::hello => Diamond_A::hello', '... method resolved itself as expected'); diff --git a/t/mro/next_skip.t b/t/mro/next_skip.t index 6bd73d0..42a276e 100644 --- a/t/mro/next_skip.t +++ b/t/mro/next_skip.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 10; +require q(./test.pl); plan(tests => 10); =pod @@ -56,10 +56,10 @@ This tests the classic diamond inheritence pattern. } -is_deeply( +ok(eq_array( mro::get_linear_isa('Diamond_D'), - [ qw(Diamond_D Diamond_B Diamond_C Diamond_A) ], - '... got the right MRO for Diamond_D'); + [ qw(Diamond_D Diamond_B Diamond_C Diamond_A) ] +), '... got the right MRO for Diamond_D'); is(Diamond_D->foo, 'Diamond_D::foo => Diamond_C::foo', '... skipped B and went to C correctly'); is(Diamond_D->bar, 'Diamond_D::bar => Diamond_A::bar', '... skipped B & C and went to A correctly'); diff --git a/t/mro/vulcan_c3.t b/t/mro/vulcan_c3.t index 9ac1c45..f0fffde 100644 --- a/t/mro/vulcan_c3.t +++ b/t/mro/vulcan_c3.t @@ -2,15 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 1; -use mro; +require q(./test.pl); plan(tests => 1); =pod @@ -67,7 +60,7 @@ example taken from: L use base ('Intelligent', 'Humanoid'); } -is_deeply( +ok(eq_array( mro::get_linear_isa('Vulcan'), - [ qw(Vulcan Intelligent Sentient Humanoid BiPedal LifeForm Object) ], - '... got the right MRO for the Vulcan Dylan Example'); + [ qw(Vulcan Intelligent Sentient Humanoid BiPedal LifeForm Object) ] +), '... got the right MRO for the Vulcan Dylan Example'); diff --git a/t/mro/vulcan_dfs.t b/t/mro/vulcan_dfs.t index 4941294..28372ad 100644 --- a/t/mro/vulcan_dfs.t +++ b/t/mro/vulcan_dfs.t @@ -2,15 +2,8 @@ use strict; use warnings; -BEGIN { - unless (-d 'blib') { - chdir 't' if -d 't'; - @INC = '../lib'; - } -} -use Test::More tests => 1; -use mro; +require q(./test.pl); plan(tests => 1); =pod @@ -67,7 +60,7 @@ example taken from: L use base ('Intelligent', 'Humanoid'); } -is_deeply( +ok(eq_array( mro::get_linear_isa('Vulcan'), - [ qw(Vulcan Intelligent Sentient LifeForm Object Humanoid BiPedal) ], - '... got the right MRO for the Vulcan Dylan Example'); + [ qw(Vulcan Intelligent Sentient LifeForm Object Humanoid BiPedal) ] +), '... got the right MRO for the Vulcan Dylan Example');