diff options
Diffstat (limited to 't/lib/croak/regcomp')
-rw-r--r-- | t/lib/croak/regcomp | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/t/lib/croak/regcomp b/t/lib/croak/regcomp index 476b239fa7..74e70ed363 100644 --- a/t/lib/croak/regcomp +++ b/t/lib/croak/regcomp @@ -77,15 +77,54 @@ EXPECT Too many nested open parens in regex; marked by <-- HERE in m/(( <-- HERE a))/ at - line 3. ######## # NAME \K not permitted in lookahead -$x =~ /(?=a\Ka)a/; +qr/(?=a\Ka)a/; EXPECT \K not permitted in lookahead/lookbehind in regex; marked by <-- HERE in m/(?=a\K <-- HERE a)a/ at - line 1. ######## +# NAME \K not permitted in lookahead (alpha) +no warnings 'experimental::alpha_assertions'; +qr/(*positive_lookahead:a\Ka)a/; +EXPECT +\K not permitted in lookahead/lookbehind in regex; marked by <-- HERE in m/(*positive_lookahead:a\K <-- HERE a)a/ at - line 2. +######## +# NAME \K not permitted in negative lookahead +qr/(?!a\Ka)a/; +EXPECT +\K not permitted in lookahead/lookbehind in regex; marked by <-- HERE in m/(?!a\K <-- HERE a)a/ at - line 1. +######## +# NAME \K not permitted in negative lookahead (alpha) +no warnings 'experimental::alpha_assertions'; +qr/(*negative_lookahead:a\Ka)a/; +EXPECT +\K not permitted in lookahead/lookbehind in regex; marked by <-- HERE in m/(*negative_lookahead:a\K <-- HERE a)a/ at - line 2. +######## # NAME \K not permitted in lookbehind -$x =~ /(?<=a\Ka)a/; +qr/(?<=a\Ka)a/; EXPECT \K not permitted in lookahead/lookbehind in regex; marked by <-- HERE in m/(?<=a\K <-- HERE a)a/ at - line 1. ######## +# NAME \K not permitted in lookbehind (alpha) +no warnings 'experimental::alpha_assertions'; +qr/(*positive_lookbehind:a\Ka)a/; +EXPECT +\K not permitted in lookahead/lookbehind in regex; marked by <-- HERE in m/(*positive_lookbehind:a\K <-- HERE a)a/ at - line 2. +######## +# NAME \K not permitted in negative lookbehind +qr/(?<!a\Ka)a/; +EXPECT +\K not permitted in lookahead/lookbehind in regex; marked by <-- HERE in m/(?<!a\K <-- HERE a)a/ at - line 1. +######## +# NAME \K not permitted in negative lookbehind (alpha) +no warnings 'experimental::alpha_assertions'; +qr/(*negative_lookbehind:a\Ka)a/; +EXPECT +\K not permitted in lookahead/lookbehind in regex; marked by <-- HERE in m/(*negative_lookbehind:a\K <-- HERE a)a/ at - line 2. +######## +# NAME \K is permitted after the lookahead GH#18123 +qr/(?=(?=x)x)\K/; +EXPECT +OPTIONS nonfatal +######## # NAME numeric parsing buffer overflow in numeric.c 0=~/\p{nV:-0}/ EXPECT |