From dd8ddecf0bb65b6799fb0f00eba6cecb12c80777 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 23 Nov 2013 22:36:26 -0800 Subject: [PATCH] Test line number for (??{$str}) regexp warnings If the (??{}) does not occur on the same line as the match operator (e.g., if we have /foo$qr/ and $qr has (??{}) in it), we need to make sure warnings that occur when the return value of (??{}) is compiled use the same line number as the /.../, since conceptually it is part of matching, not part of returning. I tried breaking this and making the line number wrong, but all tests passed, showing that it is untested. Most regcomp tests are in t/re/reg_mesg.t, but that file does not have infrastructure for check- ing line numbers. --- t/lib/warnings/regcomp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/lib/warnings/regcomp b/t/lib/warnings/regcomp index 19b6b06..b55959e 100644 --- a/t/lib/warnings/regcomp +++ b/t/lib/warnings/regcomp @@ -1,3 +1,9 @@ regcomp.c These tests have been moved to t/re/reg_mesg.t + except for those that explicitly test line numbers. __END__ +use warnings 'regexp'; +$r=qr/(??{ q"\\b+" })/; +"a" =~ /a$r/; # warning should come from this line +EXPECT +\b+ matches null string many times in regex; marked by <-- HERE in m/\b+ <-- HERE / at - line 3. -- 2.7.4