summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-03-01 10:03:25 -0700
committerKarl Williamson <public@khwilliamson.com>2011-03-01 10:35:01 -0700
commit3955e1a9ae24737181ef9e4daba13179b936e4c9 (patch)
tree899802803fbedc1df763df32053d6e3ac380f117 /t
parent7bccef0b00916eda11696a7ea88cfd578df216cd (diff)
downloadperl-3955e1a9ae24737181ef9e4daba13179b936e4c9.tar.gz
toke.c: Raise error for multiple regexp mods
When the new regular expression modifiers being allowed in suffix-form were added on a very tight schedule, it was with the understanding that the error checking that only one can occur per regular experssion would be added later. This accomplishes that.
Diffstat (limited to 't')
-rw-r--r--t/lib/warnings/toke13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke
index 425b613485..59dc752dfc 100644
--- a/t/lib/warnings/toke
+++ b/t/lib/warnings/toke
@@ -956,3 +956,16 @@ EXPECT
"\c," is more clearly written simply as "l" at - line 4.
"\c`" is more clearly written simply as "\ " at - line 5.
"\c{" is deprecated and is more clearly written as ";" at - line 7.
+########
+# toke.c
+use warnings 'syntax' ;
+my $a = qr/foo/du;
+$a = qr/foo/laai;
+$a = qr/foo/lil;
+no warnings 'syntax' ;
+my $a = qr/foo/du;
+EXPECT
+Regexp modifiers "/d" and "/u" are mutually exclusive at - line 3, near "= "
+Regexp modifiers "/l" and "/a" are mutually exclusive at - line 4, near "= "
+Regexp modifier "/l" may not appear twice at - line 5, near "= "
+BEGIN not safe after errors--compilation aborted at - line 6.