houseabsolute / p5-Test-Vars

Detects unused variables in unit tests
https://metacpan.org/pod/Test::Vars
Other
6 stars 10 forks source link

Test failure with lexical subs under 5.26 #41

Closed djerius closed 3 years ago

djerius commented 3 years ago
% perl -v

This is perl 5, version 28, subversion 1 (v5.28.1) built for x86_64-linux_debian-10-thread-multi

% perl -MTest::Vars -E 'say Test::Vars->VERSION'
0.014

Placing the following code in lib/bug.pm (and for some reason it must be in a subdirectory),

package bug;
use feature ':5.26';

sub _merge_bins  {
    my sub next_range {  };
    next_range();
    next_range();
}
1;

results in the error:

% perl  -MTest::Vars -E 'vars_ok(q[lib/bug.pm])'
not ok 1 - lib/bug.pm
#   Failed test 'lib/bug.pm'
#   at -e line 1.
# checking bug in bug.pm ...
# &next_range is used once in &bug::_merge_bins 
# Tests were run but no plan was declared and done_testing() was not seen.

I expected the code to pass the check.

autarch commented 3 years ago

I'm not really working on this distro any more. @gfx - are you still working on it? If not, I think we should give comaint to HANDOFF on PAUSE.

gfx commented 3 years ago

@autarch

+1. Thank you for maintaining a lot of modules for a long time!

djerius commented 3 years ago

Thanks!

gfx commented 3 years ago

@djerius Released v0.15 with this fix! Thanks for the report.

@autarch Gave the comaint to HANDOFF. Thank you.