From 4752d6be26cc2c1f9d3b619c52d893eab1986cea Mon Sep 17 00:00:00 2001 From: jnthn Date: Wed, 1 Jul 2015 00:02:37 +0200 Subject: [PATCH] Tests for RT #72440. --- S05-metachars/tilde.t | 6 +++++- S05-metasyntax/repeat.t | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/S05-metachars/tilde.t b/S05-metachars/tilde.t index c61f062d6b..c04ed5070d 100644 --- a/S05-metachars/tilde.t +++ b/S05-metachars/tilde.t @@ -1,7 +1,7 @@ use v6; use Test; -plan 27; +plan 29; # L @@ -74,4 +74,8 @@ ok 'x(ab' !~~ m/<&t1>/, '~ and constant atoms (missing closing bracket)'; is ($0,$1), ("c","b"), "~ operator in regexp does not revert capture order"; } +# RT #72440 +ok "(f)oo" ~~ /^ \( ~ \) foo $/, 'Only take single atom after goal (1)'; +nok "(fo)o" ~~ /^ \( ~ \) foo $/, 'Only take single atom after goal (2)'; + # vim: ft=perl6 diff --git a/S05-metasyntax/repeat.t b/S05-metasyntax/repeat.t index eda050c65f..fe14688371 100644 --- a/S05-metasyntax/repeat.t +++ b/S05-metasyntax/repeat.t @@ -14,7 +14,7 @@ be valid perl6. # Note: single-quotes.t tests repetition on single quoted items in regexes. -plan 27; +plan 29; # L @@ -75,4 +75,8 @@ ok ('a b,c,d' ~~ token { \w \s \w+ % \, }), 'can combine % with backslash charac 'adequate error message when backtrack control is out of control'; } +# RT #72440 +ok '1a2a3bc' ~~ /^ \d+ % abc $/, '% only takes single atom as separator'; +nok '1ab2ab3c' ~~ /^ \d+ % abc $/, '% only takes single atom as separator'; + # vim: ft=perl6