This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove the port to MiNT. It's a dead platform that hasn't had any love since 5.005
[perl5.git] / t / op / reg_fold.t
CommitLineData
24df86f6
RGS
1#!perl
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
0214bff6 6 require './test.pl';
24df86f6
RGS
7}
8
a0a388a1
YO
9use strict;
10use warnings;
a0a388a1
YO
11my $count=1;
12my @tests;
a0a388a1
YO
13
14my $file="../lib/unicore/CaseFolding.txt";
24df86f6 15open my $fh,"<",$file or die "Failed to read '$file': $!";
a0a388a1
YO
16while (<$fh>) {
17 chomp;
18 my ($line,$comment)= split/\s+#\s+/, $_;
19 my ($cp,$type,@fc)=split/[\s;]+/,$line||'';
20 next unless $type and ($type eq 'F' or $type eq 'C');
21 $_="\\x{$_}" for @fc;
22 my $cpv=hex("0x$cp");
23 my $chr="chr(0x$cp)";
24 my @str;
25 push @str,$chr if $cpv<128 or $cpv>256;
26 if ($cpv<256) {
27 push @str,"do{my \$c=$chr; utf8::upgrade(\$c); \$c}"
28 }
24df86f6
RGS
29
30 foreach my $str ( @str ) {
a0a388a1
YO
31 my $expr="$str=~/@fc/ix";
32 my $t=($cpv > 256 || $str=~/^do/) ? "unicode" : "latin";
33 push @tests,
34 qq[ok($expr,'$chr=~/@fc/ix - $comment ($t string)')];
0214bff6 35 $tests[-1]="TODO: { local \$::TODO='[13:41] <BinGOs> cue *It is all Greek to me* joke.';\n$tests[-1] }"
a0a388a1
YO
36 if $cp eq '0390' or $cp eq '03B0';
37 $count++;
38 }
24df86f6 39}
a0a388a1
YO
40eval join ";\n","plan tests=>".($count-1),@tests,"1"
41 or die $@;
42__DATA__