Skip to content

Commit 669d23b

Browse files
add TODO test for RT#85961: $Foo::VERSION implying package Foo
1 parent 2386142 commit 669d23b

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

t/extract-package.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ package Simple''Edward;
9999
package Simple-Edward;
100100
---
101101
},
102+
{
103+
name => 'no assumption of package merely if its $VERSION is referenced',
104+
package => [ 'Simple' ],
105+
code => <<'---',
106+
package Simple;
107+
$Foo::Bar::VERSION = '1.23';
108+
---
109+
TODO => 'fix me! RT#85961',
110+
},
102111
);
103112

104113
my $test_num = 0;

t/extract-version.t

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,20 @@ our $VERSION = "1.23";
296296
vers => '1.23_01',
297297
all_versions => { Simple => '1.23_01' },
298298
},
299+
{
300+
name => 'Two version assignments, no package',
301+
code => <<'---',
302+
$Simple::VERSION = '1.230';
303+
$Simple::VERSION = eval $Simple::VERSION;
304+
---
305+
vers => $undef,
306+
all_versions => { Simple => '1.230' },
307+
TODO => 'fix me! RT#85961',
308+
},
299309
{
300310
name => 'Two version assignments, should ignore second one',
301311
code => <<'---',
312+
package Simple;
302313
$Simple::VERSION = '1.230';
303314
$Simple::VERSION = eval $Simple::VERSION;
304315
---
@@ -548,6 +559,15 @@ package Simple;
548559
all_versions => { Simple => '1.23' },
549560
TODO => 'apply fix from ExtUtils-MakeMaker PR#135',
550561
},
562+
{
563+
name => 'no assumption of primary version merely if a package\'s $VERSION is referenced',
564+
code => <<'---',
565+
package Simple;
566+
$Foo::Bar::VERSION = '1.23';
567+
---
568+
vers => undef,
569+
all_versions => { 'Foo::Bar' => '1.23' },
570+
},
551571
);
552572

553573
my $test_num = 0;

0 commit comments

Comments
 (0)