change#4721 needed line number adjustments
[p5sagit/p5-mst-13.2.git] / t / pragma / warn / regcomp
index 6545778..bb208db 100644 (file)
@@ -1,37 +1,57 @@
   regcomp.c    AOK
 
-  %.*s matches null string many times   
+  Strange *+?{} on zero-length expression      [S_study_chunk]
+       /(?=a)?/
 
+  %.*s matches null string many times          [S_regpiece]
        $a = "ABC123" ; $a =~ /(?=a)*/'
 
-  Strange *+?{} on zero-length expression
+  /%.127s/: Unrecognized escape \\%c passed through"   [S_regatom] 
+       /\m/
 
-       /(?=a)?/
+  Character class syntax [. .] is reserved for future extensions [S_regpposixcc]
+
+  Character class syntax [= =] is reserved for future extensions [S_checkposixcc]
+
+  Character class syntax [%c %c] belongs inside character classes [S_checkposixcc] 
+  
+  /%.127s/: false [] range \"%*.*s\" in regexp [S_regclass]
 
-  Character class syntax [. .] is reserved for future extensions
-  Character class syntax [= =] is reserved for future extensions
+  /%.127s/: false [] range \"%*.*s\" in regexp [S_regclassutf8]
+
+  /%.127s/: Unrecognized escape \\%c in character class passed through"        [S_regclass] 
+
+  /%.127s/: Unrecognized escape \\%c in character class passed through"        [S_regclassutf8] 
 
 __END__
-# regcomp.c
-use warning 'unsafe' ;
+# regcomp.c [S_regpiece]
+use warnings 'unsafe' ;
 my $a = "ABC123" ; 
 $a =~ /(?=a)*/ ;
-no warning 'unsafe' ;
+no warnings 'unsafe' ;
 $a =~ /(?=a)*/ ;
 EXPECT
 (?=a)* matches null string many times at - line 4.
 ########
-# regcomp.c
-use warning 'unsafe' ;
+# regcomp.c [S_study_chunk]
+use warnings 'unsafe' ;
 $_ = "" ;
 /(?=a)?/;
-no warning 'unsafe' ;
+no warnings 'unsafe' ;
 /(?=a)?/;
 EXPECT
 Strange *+?{} on zero-length expression at - line 4.
 ########
-# regcomp.c
-use warning 'unsafe' ;
+# regcomp.c [S_regatom]
+use warnings 'unsafe' ;
+$a =~ /a\mb\b/ ;
+no warnings 'unsafe' ;
+$a =~ /a\mb\b/ ;
+EXPECT
+Unrecognized escape \m passed through at - line 3.
+########
+# regcomp.c [S_regpposixcc S_checkposixcc]
+use warnings 'unsafe' ;
 $_ = "" ;
 /[:alpha:]/;
 /[.bar.]/;
@@ -40,7 +60,7 @@ $_ = "" ;
 /[[.foo.]]/;
 /[[=bar=]]/;
 /[:zog:]/;
-no warning 'unsafe' ;
+no warnings 'unsafe' ;
 /[:alpha:]/;
 /[.foo.]/;
 /[=bar=]/;
@@ -48,6 +68,7 @@ no warning 'unsafe' ;
 /[[.foo.]]/;
 /[[=bar=]]/;
 /[:zog:]/;
+BEGIN { $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3 }
 /[[:zog:]]/;
 EXPECT
 Character class syntax [: :] belongs inside character classes at - line 4.
@@ -58,4 +79,83 @@ Character class syntax [= =] is reserved for future extensions at - line 6.
 Character class syntax [. .] is reserved for future extensions at - line 8.
 Character class syntax [= =] is reserved for future extensions at - line 9.
 Character class syntax [: :] belongs inside character classes at - line 10.
-Character class [:zog:] unknown at - line 19.
+Character class [:zog:] unknown at - line 20.
+########
+# regcomp.c [S_regclass]
+$_ = "";
+use warnings 'unsafe' ;
+/[a-b]/;
+/[a-\d]/;
+/[\d-b]/;
+/[\s-\d]/;
+/[\d-\s]/;
+/[a-[:digit:]]/;
+/[[:digit:]-b]/;
+/[[:alpha:]-[:digit:]]/;
+/[[:digit:]-[:alpha:]]/;
+no warnings 'unsafe' ;
+/[a-b]/;
+/[a-\d]/;
+/[\d-b]/;
+/[\s-\d]/;
+/[\d-\s]/;
+/[a-[:digit:]]/;
+/[[:digit:]-b]/;
+/[[:alpha:]-[:digit:]]/;
+/[[:digit:]-[:alpha:]]/;
+EXPECT
+/[a-\d]/: false [] range "a-\d" in regexp at - line 5.
+/[\d-b]/: false [] range "\d-" in regexp at - line 6.
+/[\s-\d]/: false [] range "\s-" in regexp at - line 7.
+/[\d-\s]/: false [] range "\d-" in regexp at - line 8.
+/[a-[:digit:]]/: false [] range "a-[:digit:]" in regexp at - line 9.
+/[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 10.
+/[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 11.
+/[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 12.
+########
+# regcomp.c [S_regclassutf8]
+BEGIN {
+    if (ord("\t") == 5) {
+        print "SKIPPED\n# ebcdic regular expression ranges differ.";
+        exit 0;
+    }
+}
+use utf8;
+$_ = "";
+use warnings 'unsafe' ;
+/[a-b]/;
+/[a-\d]/;
+/[\d-b]/;
+/[\s-\d]/;
+/[\d-\s]/;
+/[a-[:digit:]]/;
+/[[:digit:]-b]/;
+/[[:alpha:]-[:digit:]]/;
+/[[:digit:]-[:alpha:]]/;
+no warnings 'unsafe' ;
+/[a-b]/;
+/[a-\d]/;
+/[\d-b]/;
+/[\s-\d]/;
+/[\d-\s]/;
+/[a-[:digit:]]/;
+/[[:digit:]-b]/;
+/[[:alpha:]-[:digit:]]/;
+/[[:digit:]-[:alpha:]]/;
+EXPECT
+/[a-\d]/: false [] range "a-\d" in regexp at - line 12.
+/[\d-b]/: false [] range "\d-" in regexp at - line 13.
+/[\s-\d]/: false [] range "\s-" in regexp at - line 14.
+/[\d-\s]/: false [] range "\d-" in regexp at - line 15.
+/[a-[:digit:]]/: false [] range "a-[:digit:]" in regexp at - line 16.
+/[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 17.
+/[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 18.
+/[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 19.
+########
+# regcomp.c [S_regclass S_regclassutf8]
+use warnings 'unsafe' ;
+$a =~ /[a\zb]/ ;
+no warnings 'unsafe' ;
+$a =~ /[a\zb]/ ;
+EXPECT
+/[a\zb]/: Unrecognized escape \z in character class passed through at - line 3.