This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
preserve code blocks in interpolated qr//s
[perl5.git] / t / re / re_tests
index 6952f30..708c9ed 100644 (file)
@@ -537,10 +537,10 @@ a(?{})b   cabd    y       $&      ab
 a(?{f()+       -       c       -       Missing right curly or square bracket
 a(?{{1}+       -       c       -       Missing right curly or square bracket
 a(?{}})b       -       c       -       
-a(?{"{"})b     -       c       -       Sequence (?{...}) not terminated or not {}-balanced
+a(?{"{"})b     ab      y       -       -
 a(?{"\{"})b    cabd    y       $&      ab
 a(?{"{"}})b    -       c       -       Sequence (?{...}) not terminated with ')'
-a(?{$::bl="\{"}).b     caxbd   y       $::bl   {
+a(?{$::bl="\{"}).b     caxbd   t       $::bl   {
 x(~~)*(?:(?:F)?)?      x~~     y       -       -
 ^a(?#xxx){3}c  aaac    y       $&      aaac
 '^a (?#xxx) (?#yyy) {3}c'x     aaac    y       $&      aaac
@@ -605,8 +605,8 @@ $(?<=^(a))  a       y       $1      a
 ([\w:]+::)?(\w+)$      abcd    y       $1-$2   -abcd
 ([\w:]+::)?(\w+)$      xy:z:::abcd     y       $1-$2   xy:z:::-abcd
 ^[^bcd]*(c+)   aexycd  y       $1      c
-(?{$a=2})a*aa(?{local$a=$a+1})k*c(?{$b=$a})    yaaxxaaaacd     y       $b      3
-(?{$a=2})(a(?{local$a=$a+1}))*aak*c(?{$b=$a})  yaaxxaaaacd     y       $b      4
+(?{$a=2})a*aa(?{local$a=$a+1})k*c(?{$b=$a})    yaaxxaaaacd     t       $b      3
+(?{$a=2})(a(?{local$a=$a+1}))*aak*c(?{$b=$a})  yaaxxaaaacd     t       $b      4
 (>a+)ab        aaab    n       -       -
 (?>a+)b        aaab    y       -       -
 ([[:]+)        a:[b]:  y       $1      :[
@@ -850,7 +850,7 @@ abb$        b\nca   n       -       -
 'abb$'m        b\nca   n       -       -
 (^|x)(c)       ca      y       $2      c
 a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz   x       n       -       -
-a(?{$a=2;$b=3;($b)=$a})b       yabz    y       $b      2
+a(?{$a=2;$b=3;($b)=$a})b       yabz    t       $b      2
 round\(((?>[^()]+))\)  _I(round(xs * sz),1)    y       $1      xs * sz
 '((?x:.) )'    x       y       $1-     x -
 '((?-x:.) )'x  x       y       $1-     x-
@@ -1545,6 +1545,14 @@ abc\N{def        -       c       -       \\N{NAME} must be resolved by the lexer
 /ff/i  \x{FB01}\x{FB00}        y       $&      \x{FB00}
 /fi/i  \x{FB01}\x{FB00}        y       $&      \x{FB01}
 /fi/i  \x{FB00}\x{FB01}        y       $&      \x{FB01}
+#
+# Make sure we don't see code blocks where there aren't, and vice-versa
+(?#( (?{1+)a   a       y       -       -
+'a# (?{1+'x    a       y       -       -
+ab[(?{1]       ab1     y       -       -
+ab[(?{1\](?{2] ab2     y       -       -
+ab(?{"["})cd   abcd    y       -       -
+ab\[(?{1})c    ab[c    y       -       -
 
 # These test that doesn't cut-off matching too soon in the string for
 # multi-char folds