David Cantrell
2012-11-29 12:02:00 UTC
Devel::Cover breaks my tests!
$ cat foo.pl
use strict;
use warnings;
use Test::More tests => 1;
use Attribute::Handlers;
my $attributed;
sub Foo :ATTR(CODE) {
my ($package, $symbol, $referent, $attr, $data) = @_;
$attributed = "$referent";
}
my $sub = sub :Foo(bar) {};
is($attributed, "$sub", "coderef with attributes is not re-cloned");
$ prove foo.pl
foo.pl .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.02 cusr
0.00 csys = 0.05 CPU)
Result: PASS
$ PERL5OPT=-MDevel::Cover prove foo.pl
foo.pl .. 1/1
# Failed test 'coderef with attributes is not re-cloned'
# at foo.pl line 16.
# got: 'CODE(0x100ab7138)'
# expected: 'CODE(0x100adba80)'
# Looks like you failed 1 test of 1.
foo.pl .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
Has anyone else seen this before and have a work-around? Or got a Clue
for me on where to start patching Devel::Cover?
$ cat foo.pl
use strict;
use warnings;
use Test::More tests => 1;
use Attribute::Handlers;
my $attributed;
sub Foo :ATTR(CODE) {
my ($package, $symbol, $referent, $attr, $data) = @_;
$attributed = "$referent";
}
my $sub = sub :Foo(bar) {};
is($attributed, "$sub", "coderef with attributes is not re-cloned");
$ prove foo.pl
foo.pl .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.02 cusr
0.00 csys = 0.05 CPU)
Result: PASS
$ PERL5OPT=-MDevel::Cover prove foo.pl
foo.pl .. 1/1
# Failed test 'coderef with attributes is not re-cloned'
# at foo.pl line 16.
# got: 'CODE(0x100ab7138)'
# expected: 'CODE(0x100adba80)'
# Looks like you failed 1 test of 1.
foo.pl .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
Has anyone else seen this before and have a work-around? Or got a Clue
for me on where to start patching Devel::Cover?
--
David Cantrell | London Perl Mongers Deputy Chief Heretic
Irregular English:
ladies glow; gentlemen perspire; brutes, oafs and athletes sweat
David Cantrell | London Perl Mongers Deputy Chief Heretic
Irregular English:
ladies glow; gentlemen perspire; brutes, oafs and athletes sweat