Skip to content

Commit f9ce8d5

Browse files
committed
rename internal test module to not be 'Test2'
Test2 is a real module (even though it has no functionality) so it is confusing to have a test script use the name for an internal test module. Rename the module to avoid the confusion.
1 parent b713bbf commit f9ce8d5

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

t/op/require_gh20577.t

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ eval <<'EOF' or die $@;
1212
{
1313
my %fatpacked;
1414
15-
$fatpacked{"Test1.pm"} = <<'TEST1';
16-
package Test1;
15+
$fatpacked{"TestModule1.pm"} = <<'TEST1';
16+
package TestModule1;
1717
sub import {
18-
my $filename = 'Test2.pm';
18+
my $filename = 'TestModule2.pm';
1919
$INC{$filename} = "the_test_file";
2020
}
2121
1;
2222
TEST1
2323
24-
$fatpacked{"Test2.pm"} = <<'TEST2';
25-
package Test2;
26-
use Test1;
24+
$fatpacked{"TestModule2.pm"} = <<'TEST2';
25+
package TestModule2;
26+
use TestModule1;
2727
1;
2828
TEST2
2929
@@ -45,14 +45,14 @@ TEST2
4545
EOF
4646

4747
ok(UNIVERSAL::isa($INC[0],"FatPacked"), '$INC[0] starts FatPacked');
48-
ok(!exists $INC{"Test1.pm"}, 'Test1.pm not in %INC');
49-
ok(!exists $INC{"Test2.pm"}, 'Test2.pm not in %INC');
50-
my $ok= eval "use Test2; 1";
48+
ok(!exists $INC{"TestModule1.pm"}, 'TestModule1.pm not in %INC');
49+
ok(!exists $INC{"TestModule2.pm"}, 'TestModule2.pm not in %INC');
50+
my $ok= eval "use TestModule2; 1";
5151
my $err= !$ok ? $@ : undef;
52-
is($err,undef,"No error loading Test2");
53-
is($ok,1,"Loaded Test2 successfully");
52+
is($err,undef,"No error loading TestModule2");
53+
is($ok,1,"Loaded TestModule2 successfully");
5454
ok(UNIVERSAL::isa($INC[0],"FatPacked"), '$INC[0] is still FatPacked');
55-
ok(UNIVERSAL::isa($INC{"Test1.pm"},"FatPacked"), '$INC{"Test1.pm"} is still FatPacked');
56-
is($INC{"Test2.pm"},"the_test_file", '$INC{"Test2.pm"} is as expected');
57-
is($INC[0],$INC{"Test1.pm"},'Same object in @INC and %INC');
55+
ok(UNIVERSAL::isa($INC{"TestModule1.pm"},"FatPacked"), '$INC{"TestModule1.pm"} is still FatPacked');
56+
is($INC{"TestModule2.pm"},"the_test_file", '$INC{"TestModule2.pm"} is as expected');
57+
is($INC[0],$INC{"TestModule1.pm"},'Same object in @INC and %INC');
5858
done_testing();

0 commit comments

Comments
 (0)