Skip Menu |

This queue is for tickets about the Module-Pluggable CPAN distribution.

Report information
The Basics
Id: 111539
Status: open
Priority: 0/
Queue: Module-Pluggable

People
Owner: Nobody in particular
Requestors: GRUBERT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Module-Pluggable-5.2 Test fails: t/10innerpack_super.t ........ 1/3 # Failed test 'Still pick up other inner package' # at t/10innerpack_super.t line 8. # Structures begin differing at: # $got->[0] = 'Foo::Driver' # $expected->[0] = 'Foo::Bar' # Looks like you failed 1 test of 3. On perl 5.22.
On 2016-01-29 04:39:52, GRUBERT wrote: Show quoted text
> Module-Pluggable-5.2 Test fails: > > t/10innerpack_super.t ........ 1/3 > # Failed test 'Still pick up other inner package' > # at t/10innerpack_super.t line 8. > # Structures begin differing at: > # $got->[0] = 'Foo::Driver' > # $expected->[0] = 'Foo::Bar' > # Looks like you failed 1 test of 3. > > On perl 5.22. >
I guess you have a "Foo.pm" in your perl installation. At least I can reproduce this error if I create a Foo.pm with the following contents: package Foo; sub whee {} package Foo::Driver; sub whee {} 1; __END__ Problem is that "use base" has to guess if a package is already loaded or not (I think it does this by checking for the existence of $VERSION in the package). Here this heuristics fails, and Foo.pm (a wrong one) is loaded. This can be workarounded by using 'use parent -norequire => "Foo"' instead. See https://github.com/PerlDancer/Dancer/issues/1127 for a similar case.
On 2016-01-29 14:30:30, SREZIC wrote: Show quoted text
> On 2016-01-29 04:39:52, GRUBERT wrote:
> > Module-Pluggable-5.2 Test fails: > > > > t/10innerpack_super.t ........ 1/3 > > # Failed test 'Still pick up other inner package' > > # at t/10innerpack_super.t line 8. > > # Structures begin differing at: > > # $got->[0] = 'Foo::Driver' > > # $expected->[0] = 'Foo::Bar' > > # Looks like you failed 1 test of 3. > > > > On perl 5.22. > >
> > I guess you have a "Foo.pm" in your perl installation. At least I can > reproduce this error if I create a Foo.pm with the following contents: > > package Foo; > sub whee {} > package Foo::Driver; > sub whee {} > 1; > __END__ > > Problem is that "use base" has to guess if a package is already loaded > or not (I think it does this by checking for the existence of $VERSION > in the package). Here this heuristics fails, and Foo.pm (a wrong one) > is loaded. > > This can be workarounded by using 'use parent -norequire => "Foo"' > instead. > > See https://github.com/PerlDancer/Dancer/issues/1127 for a similar > case.
Attached a patch.
Subject: 0001-workaround-for-RT-111539.patch
From 97ba55cdcdc9266195c98094fff6a6822c8fa30e Mon Sep 17 00:00:00 2001 From: Slaven Rezic <slaven@rezic.de> Date: Fri, 29 Jan 2016 19:29:22 +0000 Subject: [PATCH] workaround for RT #111539 --- t/10innerpack_super.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/10innerpack_super.t b/t/10innerpack_super.t index e9a58bd..bab273a 100644 --- a/t/10innerpack_super.t +++ b/t/10innerpack_super.t @@ -18,7 +18,7 @@ package Foo::Bar; sub whee {} package Bar; -use base 'Foo'; +use parent -norequire => 'Foo'; sub whee { shift->SUPER::whee; -- 1.7.10.4