summaryrefslogtreecommitdiff
path: root/t/mro
diff options
context:
space:
mode:
authorNicolas R <atoomic@cpan.org>2017-09-14 14:52:19 -0600
committerJames E Keenan <jkeenan@cpan.org>2017-09-15 13:17:14 -0400
commitc21c9dc52daa35bc02d509e7cf6cb7f3a33dcc36 (patch)
tree007da517800c1fb918def17cd3da42d2c5be2b6c /t/mro
parent8b07d9e2085efc07ae6203ced3ea96189339a52e (diff)
downloadperl-c21c9dc52daa35bc02d509e7cf6cb7f3a33dcc36.tar.gz
test - Do not use B which is a reserved namespace
B is already a reserved namespace. This is a bad idea to use B during unit test, as this increase the complexity when using one of the B subpackage to run the test. Simply rename B to BB ( and A to AA ). (Whitesapce cleanup by committer.) For: RT # 132092
Diffstat (limited to 't/mro')
-rw-r--r--t/mro/next_inanon.t18
-rw-r--r--t/mro/next_ineval.t16
2 files changed, 17 insertions, 17 deletions
diff --git a/t/mro/next_inanon.t b/t/mro/next_inanon.t
index b6f0451611..4c3c007d6e 100644
--- a/t/mro/next_inanon.t
+++ b/t/mro/next_inanon.t
@@ -13,26 +13,26 @@ anonymous subroutine.
=cut
{
- package A;
+ package AA;
use mro 'c3';
sub foo {
- return 'A::foo';
+ return 'AA::foo';
}
sub bar {
- return 'A::bar';
+ return 'AA::bar';
}
}
{
- package B;
- use base 'A';
+ package BB;
+ use base 'AA';
use mro 'c3';
sub foo {
my $code = sub {
- return 'B::foo => ' . (shift)->next::method();
+ return 'BB::foo => ' . (shift)->next::method();
};
return (shift)->$code;
}
@@ -40,7 +40,7 @@ anonymous subroutine.
sub bar {
my $code1 = sub {
my $code2 = sub {
- return 'B::bar => ' . (shift)->next::method();
+ return 'BB::bar => ' . (shift)->next::method();
};
return (shift)->$code2;
};
@@ -48,10 +48,10 @@ anonymous subroutine.
}
}
-is(B->foo, "B::foo => A::foo",
+is(BB->foo, "BB::foo => AA::foo",
'method resolved inside anonymous sub');
-is(B->bar, "B::bar => A::bar",
+is(BB->bar, "BB::bar => AA::bar",
'method resolved inside nested anonymous subs');
diff --git a/t/mro/next_ineval.t b/t/mro/next_ineval.t
index f8c13a6413..14a49b1c6b 100644
--- a/t/mro/next_ineval.t
+++ b/t/mro/next_ineval.t
@@ -12,23 +12,23 @@ This tests the use of an eval{} block to wrap a next::method call.
=cut
{
- package A;
+ package AA;
use mro 'c3';
sub foo {
- die 'A::foo died';
- return 'A::foo succeeded';
+ die 'AA::foo died';
+ return 'AA::foo succeeded';
}
}
{
- package B;
- use base 'A';
+ package BB;
+ use base 'AA';
use mro 'c3';
sub foo {
eval {
- return 'B::foo => ' . (shift)->next::method();
+ return 'BB::foo => ' . (shift)->next::method();
};
if ($@) {
@@ -37,8 +37,8 @@ This tests the use of an eval{} block to wrap a next::method call.
}
}
-like(B->foo,
- qr/^A::foo died/,
+like(BB->foo,
+ qr/^AA::foo died/,
'method resolved inside eval{}');