diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-18 17:54:44 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-18 17:54:44 +0000 |
commit | 1c7ca16b42c3025d26585650ea197c1f5b2aeca6 (patch) | |
tree | 7c114af08293ef6c3641986dd715ff8b55912459 /t/uni | |
parent | 3c0aeaa706f7e14a4884e6269a5bce4b2c834d70 (diff) | |
download | perl-1c7ca16b42c3025d26585650ea197c1f5b2aeca6.tar.gz |
What do you know; these tests unearthed nasty problems.
Will resolve those first.
p4raw-id: //depot/perl@14752
Diffstat (limited to 't/uni')
-rw-r--r-- | t/uni/case.pl | 76 | ||||
-rw-r--r-- | t/uni/lower.t | 8 | ||||
-rw-r--r-- | t/uni/title.t | 8 | ||||
-rw-r--r-- | t/uni/upper.t | 8 |
4 files changed, 0 insertions, 100 deletions
diff --git a/t/uni/case.pl b/t/uni/case.pl deleted file mode 100644 index 25f8f4c977..0000000000 --- a/t/uni/case.pl +++ /dev/null @@ -1,76 +0,0 @@ -use File::Spec; - -require "test.pl"; - -sub casetest { - my ($base, $spec, $func) = @_; - my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, - "lib", "unicore", "To"), - "$base.pl"); - my $simple = do $file; - my %simple; - for my $i (split(/\n/, $simple)) { - my ($k, $v) = split(' ', $i); - $simple{$k} = $v; - } - my %seen; - - for my $i (sort keys %simple) { - $seen{hex $i}++; - } - print "# ", scalar keys %simple, " simple mappings\n"; - - my $both; - - for my $i (sort keys %$spec) { - $both++ if ++$seen{hex $i} == 2; - } - print "# ", scalar keys %$spec, " special mappings\n"; - - my %none; - for my $i (map { ord } split //, - "\e !\"#\$%&'()+,-./0123456789:;<=>?\@[\\]^_{|}~\b") { - next if pack("U0U", $i) =~ /\w/; - $none{$i}++ unless $seen{$i}; - } - print "# ", scalar keys %none, " noncase mappings\n"; - - my $tests = - (scalar keys %simple) + - (scalar keys %$spec) + - (scalar keys %none) - $both; - print "1..$tests\n"; - - my $test = 1; - - for my $i (sort { hex $a <=> hex $b } keys %simple) { - my $w = "$i -> $simple{$i}"; - my $c = pack "U0U", hex $i; - my $d = $func->($c); - print $d eq pack("U0U", hex $simple{$i}) ? - "ok $test # $w\n" : "not ok $test # $w\n"; - $test++; - } - - for my $i (sort { hex $a <=> hex $b } keys %$spec) { - next if $seen{hex $i} == 2; - my $w = qq[$i -> "] . display($spec->{$i}) . qq["]; - my $c = pack "U0U", hex $i; - my $d = $func->($c); - print $d eq $spec->{$i} ? - "ok $test # $w\n" : "not ok $test # $w\n"; - $test++; - } - - - for my $i (sort { $a <=> $b } keys %none) { - my $w = sprintf "%04X -> %04X", $i, $i; - my $c = pack "U0U", $i; - my $d = $func->($c); - print $d eq $c ? - "ok $test # $w\n" : "not ok $test # $w\n"; - $test++; - } -} - -1; diff --git a/t/uni/lower.t b/t/uni/lower.t deleted file mode 100644 index 4420d0b165..0000000000 --- a/t/uni/lower.t +++ /dev/null @@ -1,8 +0,0 @@ -BEGIN { - chdir 't' if -d 't'; - @INC = qw(../lib uni .); - require "case.pl"; -} - -casetest("Lower", \%utf8::ToSpecLower, sub { lc $_[0] }); - diff --git a/t/uni/title.t b/t/uni/title.t deleted file mode 100644 index c0b7e3a016..0000000000 --- a/t/uni/title.t +++ /dev/null @@ -1,8 +0,0 @@ -BEGIN { - chdir 't' if -d 't'; - @INC = qw(../lib uni .); - require "case.pl"; -} - -casetest("Title", \%utf8::ToSpecTitle, sub { ucfirst $_[0] }); - diff --git a/t/uni/upper.t b/t/uni/upper.t deleted file mode 100644 index 5694c26f22..0000000000 --- a/t/uni/upper.t +++ /dev/null @@ -1,8 +0,0 @@ -BEGIN { - chdir 't' if -d 't'; - @INC = qw(../lib uni .); - require "case.pl"; -} - -casetest("Upper", \%utf8::ToSpecUpper, sub { uc $_[0] }); - |