Skip to content

Commit

Permalink
fixup 1-basic.t for v5.29.9 Variable length lookbehind support
Browse files Browse the repository at this point in the history
Now implemented and the not-found return value changed from undef to ''
  • Loading branch information
rurban committed Apr 8, 2019
1 parent 18c2822 commit 6b5cc9b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions t/1-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ use strict;
use Test::More tests => 6;
use re::engine::PCRE2;

# pcre extension only: perl: Variable length lookbehind not implemented
# implemented in perl5 since 5.29.9 [perl #132367]
# before pcre extension only: perl: Variable length lookbehind not implemented
ok("Hello, world" !~ /(?<=Moose|Mo), (world)/);
is($1, undef);
ok(!$1); # v5.29.9 returns '', before undef

ok("Hello, world" =~ /(?<=Hello|Hi), (world)/);
is($1, 'world');

no re::engine::PCRE2;
is(eval '"Hello, world" =~ /(?<=Moose|Mo), (world)/', undef);
ok(!eval '"Hello, world" =~ /(?<=Moose|Mo), (world)/'); # undef or ''

if (fork) {
ok(1);
Expand Down

0 comments on commit 6b5cc9b

Please sign in to comment.