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;
}
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'));
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
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');
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
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');
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
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');
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
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');
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
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');
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
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');
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
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');
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
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');
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
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',
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
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',
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
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');
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
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');
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
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
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');
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
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
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');
use strict;
use warnings;
-use Test::More tests => 5;
+require q(./test.pl); plan(tests => 5);
=pod
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');
use strict;
use warnings;
-use Test::More tests => 10;
+require q(./test.pl); plan(tests => 10);
=pod
}
-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');
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
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');
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
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');