# the format supported by op/regexp.t. If you want to add a test
# that does fit that format, add it to op/re_tests, not here.
-print "1..581\n";
+$| = 1;
+print "1..587\n";
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
}
-eval 'use Config'; # Defaults assumed if this fails
-# XXX known to leak scalars
-$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3;
+use re 'asciirange'; # Compute ranges in ASCII space
+
+eval 'use Config'; # Defaults assumed if this fails
$x = "abc\ndef\n";
if ("ab\ncd\n" =~ /^cd/) {print "ok 24\n";} else {print "not ok 24\n";}
$* = 0;
-#$XXX{123} = 123;
-#$XXX{234} = 234;
-#$XXX{345} = 345;
-#
-#@XXX = ('ok 25','not ok 25', 'ok 26','not ok 26','not ok 27');
-#while ($_ = shift(@XXX)) {
-# ?(.*)? && (print $1,"\n");
-# /not/ && reset;
-# /not ok 26/ && reset 'X';
-#}
-#
-#while (($key,$val) = each(%XXX)) {
-# print "not ok 27\n";
-# exit;
-#}
-#
-#print "ok 27\n";
-for (25..27) { print "ok $_\n" }
+$XXX{123} = 123;
+$XXX{234} = 234;
+$XXX{345} = 345;
+
+@XXX = ('ok 25','not ok 25', 'ok 26','not ok 26','not ok 27');
+while ($_ = shift(@XXX)) {
+ ?(.*)? && (print $1,"\n");
+ /not/ && reset;
+ /not ok 26/ && reset 'X';
+}
+
+while (($key,$val) = each(%XXX)) {
+ print "not ok 27\n";
+ exit;
+}
+
+print "ok 27\n";
'cde' =~ /[^ab]*/;
'xyz' =~ //;
$_ = "a\x{100}b";
if (/(.)(\C)(\C)(.)/) {
print "ok 232\n";
- # currently \C are still tagged as UTF-8
- use bytes;
if ($1 eq "a") {
print "ok 233\n";
} else {
if (/(\C)/g) {
print "ok 237\n";
# currently \C are still tagged as UTF-8
- use bytes;
if ($1 eq "\xC4") {
print "ok 238\n";
} else {
if (/(\C)/g) {
print "ok 239\n";
# currently \C are still tagged as UTF-8
- use bytes;
if ($1 eq "\x80") {
print "ok 240\n";
} else {
}
} else {
for (244..245) {
- print "ok $_ # Skip: not EBCDIC\n";
+ print "ok $_ # Skip: only in EBCDIC\n";
}
}
print "ok 581\n";
}
+
+{
+ $test = 582;
+
+ # bugid 20010410.006
+ for my $rx (
+ '/(.*?)\{(.*?)\}/csg',
+ '/(.*?)\{(.*?)\}/cg',
+ '/(.*?)\{(.*?)\}/sg',
+ '/(.*?)\{(.*?)\}/g',
+ '/(.+?)\{(.+?)\}/csg',
+ )
+ {
+ my($input, $i);
+
+ $i = 0;
+ $input = "a{b}c{d}";
+ eval <<EOT;
+ while (eval \$input =~ $rx) {
+ print "# \\\$1 = '\$1' \\\$2 = '\$2'\n";
+ ++\$i;
+ }
+EOT
+ print "not " unless $i == 2;
+ print "ok " . $test++ . "\n";
+ }
+}
+
+{
+ # from Robin Houston
+
+ my $x = "\x{12345678}";
+ $x =~ s/(.)/$1/g;
+ print "not " unless ord($x) == 0x12345678 && length($x) == 1;
+ print "ok 587\n";
+}