Skip Menu |

This queue is for tickets about the SUPER CPAN distribution.

Report information
The Basics
Id: 27955
Status: resolved
Priority: 0/
Queue: SUPER

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

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



Subject: Test::Exception doesn't play well SUPER
I'm having a devil of a time replicating this in a clean test, otherwise I would send a patch. Here's about the smallest test case I can reproduce: #!/usr/bin/perl use strict; use warnings; { package My::Test::More; use base 'Test::Class'; INIT { Test::Class->runtests } use Test::More; sub mytest : Tests(1) { diag shift->{stuff}; ok 1, 'parent mytest'; } } { package My::Test::Class; use Test::More; use Test::Exception; use SUPER; BEGIN { @My::Test::Class::ISA = 'My::Test::More' } sub mytest : Tests(2) { shift->{stuff} = 'foo'; super; ok 1, 'mytest called'; } } 1; Run that and it produces: 1..3 # undef ok 1 - parent mytest You must call super() from a method call at test.pl line 27 not ok 2 - mytest died (Can't use an undefined value as a HASH reference at test.pl line 12.) # Failed test 'mytest died (Can't use an undefined value as a HASH reference at test.pl line 12.)' # at test.pl line 9. # (in My::Test::Class->mytest) ok 3 # skip mytest died # Looks like you failed 1 test of 3. If you remove the Test::Exception line, it works correctly: 1..3 # undef ok 1 - parent mytest # foo ok 2 - parent mytest ok 3 - mytest called This appears to be because Sub::Uplevel overrides CORE::GLOBALL::caller. In SUPER.pm, Replacing all calls to caller with CORE::caller seems to fix the problem. Cheers, Ovid
From: DAGOLDEN [...] cpan.org
On Wed Jul 04 04:14:00 2007, OVID wrote: Show quoted text
> This appears to be because Sub::Uplevel overrides CORE::GLOBALL::caller. > > In SUPER.pm, Replacing all calls to caller with CORE::caller seems to > fix the problem.
Sub-Uplevel-0.15_01 is smarter about this. Please see if that fixes the problem.
On Thu Jul 05 23:05:01 2007, DAGOLDEN wrote: Show quoted text
> On Wed Jul 04 04:14:00 2007, OVID wrote:
> > This appears to be because Sub::Uplevel overrides
CORE::GLOBALL::caller. Show quoted text
> > > > In SUPER.pm, Replacing all calls to caller with CORE::caller seems to > > fix the problem.
> > Sub-Uplevel-0.15_01 is smarter about this. Please see if that fixes the > problem.
Regrettably, I have the same symptoms :( Cheers, Ovid
I can't reproduce this now. Please feel free to open again if it occurs again with the current versions of these modules.