# 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";
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";
+}