Skip to content

Commit

Permalink
Fix failures on older Perl versions (#15)
Browse files Browse the repository at this point in the history
* [perl] Name explicit List::Util version dependency

Although List::Util is a core module (better: it's dual life), it only grew support for 'any' and 'all'
in 1.33, which doesn't come with some of the older Perl versions. Specifying the number explicitly
makes older Perls install this module from CPAN.

* [perl] Remove post-fix-deref from test suite (it's for Perl 5.22+)

* [perl] Expand tests to more Perl versions

* [Perl] Add CHANGELOG.md entry for fixes

Co-authored-by: Aslak Hellesøy <1000+aslakhellesoy@users.noreply.github.com>
  • Loading branch information
ehuelsmann and aslakhellesoy authored Oct 18, 2021
1 parent b2e14f2 commit 73db2a8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-perl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
perl: [ "5.32" ]
perl: [ "5.14", "5.20", "5.26", "5.32" ]

steps:
- name: Check out repository
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

* [Perl] Fixed missing dependency as well as new syntax in the tests
([cucumber/tag-expressions#15](https://github.com/cucumber/tag-expressions/pull/15)
[ehuelsmann])
* Document escaping. ([#16](https://github.com/cucumber/tag-expressions/issues/16), [#17](https://github.com/cucumber/tag-expressions/pull/17))
* [Ruby] Empty expression evaluates to true

Expand Down
1 change: 1 addition & 0 deletions perl/cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

requires 'perl' => '5.14.0';
requires 'Moo';
requires 'List::Util' => '1.33'; # for 'any' and 'all' functions.

on 'test' => sub {
requires 'Test2::V0';
Expand Down
4 changes: 2 additions & 2 deletions perl/t/02-evaluate.t
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ for my $ex (@good) {
}, "Parsing $ex->{expr}")
or note($@);

for my $test ($ex->{tests}->@*) {
my @tags = $test->{tags}->@*;
for my $test ( @{ $ex->{tests} } ) {
my @tags = @{ $test->{tags} };
is( $e->evaluate(@tags), $test->{outcome},
"Expr $ex->{expr}; Tags: @tags; Outcome: $test->{outcome} " )
or diag( "Parsed expression: " . $e->stringify );
Expand Down

0 comments on commit 73db2a8

Please sign in to comment.