diff options
author | Nicholas Clark <nick@ccl4.org> | 2004-05-02 18:18:25 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2004-05-02 18:18:25 +0000 |
commit | 32d0b1dc401c0761720039ad2d3c42e7ee6bf675 (patch) | |
tree | f2ddfadc4c2238fe36b77d66885dffd2702846fc /t/uni | |
parent | 71bed85a8e466f6c3e557b1ecdc84ea0b18975ee (diff) | |
download | perl-32d0b1dc401c0761720039ad2d3c42e7ee6bf675.tar.gz |
Make t/uni/class.t pass on case insensitive file systems
p4raw-id: //depot/perl@22765
Diffstat (limited to 't/uni')
-rw-r--r-- | t/uni/class.t | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/t/uni/class.t b/t/uni/class.t index 72ba7e364c..130b720eac 100644 --- a/t/uni/class.t +++ b/t/uni/class.t @@ -112,21 +112,34 @@ for my $p ('gc', 'sc') { } # test extra properties (ASCII_Hex_Digit, Bidi_Control, etc.) -for (keys %utf8::PA_reverse) { - my $filename = File::Spec->catfile( - $updir => lib => unicore => lib => gc_sc => "$utf8::PA_reverse{$_}.pl" - ); +{ + # Aargh. Nasty case insensitive filesystems mean that Cf.pl will cause a -e + # test for cf.pl to return true. So need to read the filenames explicitly + # to get a case sensitive test + my %files; - next unless -e $filename; - my ($h1, $h2) = map hex, split /\t/, (do $filename); - my $str = join "", map chr, $h1 .. (($h2 || $h1) + 1); + my $dirname = File::Spec->catdir($updir => lib => unicore => lib => gc_sc); + opendir D, $dirname or die $!; + @files{readdir D} = (); + closedir D; + + for (keys %utf8::PA_reverse) { + my $leafname = "$utf8::PA_reverse{$_}.pl"; + next unless exists $files{$leafname}; - for my $x ('gc', 'General Category') { - for my $y ($_, $utf8::PA_reverse{$_}) { - is($str =~ /(\p{$x: $y}+)/ && $1, substr($str, 0, -1)); - is($str =~ /(\P{$x= $y}+)/ && $1, substr($str, -1)); - is($str =~ /(\p{$y}+)/ && $1, substr($str, 0, -1)); - is($str =~ /(\P{$y}+)/ && $1, substr($str, -1)); + my $filename = File::Spec->catfile($dirname, $leafname); + + my ($h1, $h2) = map hex, split /\t/, (do $filename); + my $str = join "", map chr, $h1 .. (($h2 || $h1) + 1); + + for my $x ('gc', 'General Category') { + print "# $filename $x $_, $utf8::PA_reverse{$_}\n"; + for my $y ($_, $utf8::PA_reverse{$_}) { + is($str =~ /(\p{$x: $y}+)/ && $1, substr($str, 0, -1)); + is($str =~ /(\P{$x= $y}+)/ && $1, substr($str, -1)); + is($str =~ /(\p{$y}+)/ && $1, substr($str, 0, -1)); + is($str =~ /(\P{$y}+)/ && $1, substr($str, -1)); + } } } } |