Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite breaks with perl 5.33.7 and newer #7

Open
eserte opened this issue Apr 1, 2021 · 2 comments
Open

Test suite breaks with perl 5.33.7 and newer #7

eserte opened this issue Apr 1, 2021 · 2 comments

Comments

@eserte
Copy link

eserte commented Apr 1, 2021

FLIMM/Perl-Critic-Lokku-0.003.tar.gz does not have pass reports since perl 5.33.7.
See http://matrix.cpantesters.org/?dist=Perl-Critic-Lokku%200.003

On my systems t/run.t fails like this:

#   Failed test 'TryTiny::ProhibitExitingSubroutine - line 20 - A "try" invocation with "next" inside it'
#   at t/run.t line 9.
# Expected 1 violations, got 0. 

#   Failed test 'TryTiny::ProhibitExitingSubroutine - line 40 - A "try" invocation with "$i == 0 && next" inside it'
#   at t/run.t line 9.
# Expected 1 violations, got 0. 

#   Failed test 'TryTiny::ProhibitExitingSubroutine - line 60 - A "try" invocation with "next if $i == 0"'
#   at t/run.t line 9.
# Expected 1 violations, got 0. 

#   Failed test 'TryTiny::ProhibitExitingSubroutine - line 143 - A "try" invorcation with an if-block inside it'
#   at t/run.t line 9.
# Expected 1 violations, got 0. 

#   Failed test 'TryTiny::ProhibitExitingSubroutine - line 175 - A "try" invocation with a for-loop, and a "next" outside'
#   at t/run.t line 9.
# Expected 1 violations, got 0. 

#   Failed test 'TryTiny::ProhibitExitingSubroutine - line 206 - A "try" invocation with subref inside it, with "try" inside it, with "return"'
#   at t/run.t line 9.
# Expected 1 violations, got 0. 

#   Failed test 'TryTiny::RequireCatch - line 1 - "try" on its own'
#   at t/run.t line 9.
# Expected 1 violations, got 0. 

#   Failed test 'TryTiny::RequireCatch - line 12 - "try" with "finally" block'
#   at t/run.t line 9.
# Expected 1 violations, got 0. 

#   Failed test 'TryTiny::RequireCatch - line 67 - "try" in an if block'
#   at t/run.t line 9.
# Expected 1 violations, got 0. 
# Looks like you failed 9 tests of 23.
t/run.t ............... 
Dubious, test returned 9 (wstat 2304, 0x900)
Failed 9/23 subtests 
@eserte
Copy link
Author

eserte commented May 3, 2021

It seems that the problem is that "try" is now a perl bareword, even if the new experimental "try" feature is not enabled.
This means that the check in https://metacpan.org/source/FLIMM/Perl-Critic-Lokku-0.003/lib/Perl/Critic/Policy/TryTiny/ProhibitExitingSubroutine.pm#L52 does not work anymore --- is_function_call() returns falls if is_perl_bareword() returns true.

See also https://metacpan.org/source/RURBAN/B-Keywords-1.22/lib/B/Keywords.pm#L455-459

eserte added a commit to eserte/Perl-Critic-Lokku that referenced this issue May 4, 2021
eserte added a commit to eserte/Perl-Critic-Lokku that referenced this issue May 4, 2021
@Flimm
Copy link
Collaborator

Flimm commented Aug 31, 2021

Please note that Perl::Critic::Lokku has been deleted from CPAN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants