diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-11-23 22:36:26 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-11-24 07:45:51 -0800 |
commit | dd8ddecf0bb65b6799fb0f00eba6cecb12c80777 (patch) | |
tree | b65e1012575e4523da4082e6c20feaba853f6a7a /t | |
parent | 0ac75573be35d04f7799c8b980c842497e4cbd07 (diff) | |
download | perl-dd8ddecf0bb65b6799fb0f00eba6cecb12c80777.tar.gz |
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.
Diffstat (limited to 't')
-rw-r--r-- | t/lib/warnings/regcomp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/t/lib/warnings/regcomp b/t/lib/warnings/regcomp index 19b6b06f6f..b55959e070 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. |