summaryrefslogtreecommitdiff
path: root/t/lib
diff options
context:
space:
mode:
authorKarl Williamson <khw@khw-desktop.(none)>2010-07-18 12:28:14 -0600
committerRafael Garcia-Suarez <rgs@consttype.org>2010-09-16 15:09:26 +0200
commitc99e91e919b4bb89bab7829a9026ee01b1fff2a1 (patch)
tree5b069e6bd24b358e42e94e01b97424d5a09d9bfc /t/lib
parenteb06eac93f0120092363c6c7ba87bb7054e76844 (diff)
downloadperl-c99e91e919b4bb89bab7829a9026ee01b1fff2a1.tar.gz
Fix /[\8]/ to not match NULL; give correct warning
8 and 9 are not treated as alphas in parsing as opposed to illegal octals. This also adds tests to verify that 1-3 digits work in char classes. I created an isOCTAL macro in case that lookup gets moved to a bit field, as I plan to do later, for speed.
Diffstat (limited to 't/lib')
-rw-r--r--t/lib/warnings/regcomp13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/lib/warnings/regcomp b/t/lib/warnings/regcomp
index 6bc684568b..98280f61f4 100644
--- a/t/lib/warnings/regcomp
+++ b/t/lib/warnings/regcomp
@@ -237,3 +237,16 @@ Missing braces on \o{} in regex; marked by <-- HERE in m/[\o <-- HERE ]/ at - li
$a = qr/[\o{}]/;
EXPECT
Number with no digits in regex; marked by <-- HERE in m/[\o{} <-- HERE ]/ at - line 2.
+########
+# regcomp.c [S_regclass]
+use warnings 'regexp' ;
+$a = qr/[\8\9]/;
+$a = qr/[\_\0]/; # Should have no warnings on this and the remainder of this test
+$a = qr/[\07]/;
+$a = qr/[\006]/;
+$a = qr/[\0005]/;
+no warnings 'regexp' ;
+$a = qr/[\8\9]/;
+EXPECT
+Unrecognized escape \8 in character class passed through in regex; marked by <-- HERE in m/[\8 <-- HERE \9]/ at - line 3.
+Unrecognized escape \9 in character class passed through in regex; marked by <-- HERE in m/[\8\9 <-- HERE ]/ at - line 3.