From 5381febe8f5f7c1aad3226a69514f22cfffccf29 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 28 May 2001 16:58:11 +0000 Subject: Various buglets shaken out by -Mutf8. p4raw-id: //depot/perl@10260 --- t/io/utf8.t | 2 ++ t/lib/charnames.t | 2 ++ t/lib/lc-language.t | 2 ++ t/pragma/locale.t | 48 +++++++++++++++++++----------------------------- 4 files changed, 25 insertions(+), 29 deletions(-) (limited to 't') diff --git a/t/io/utf8.t b/t/io/utf8.t index ac5cde7a6e..fee0fe6ace 100755 --- a/t/io/utf8.t +++ b/t/io/utf8.t @@ -9,6 +9,8 @@ BEGIN { } } +no utf8; # so that the naked 8-bit chars won't gripe under use utf8 + $| = 1; my $total_tests = 25; if (ord('A') == 193) { $total_tests = 24; } # EBCDIC platforms do not warn on UTF-8 diff --git a/t/lib/charnames.t b/t/lib/charnames.t index 07c91e6682..124dad0971 100644 --- a/t/lib/charnames.t +++ b/t/lib/charnames.t @@ -117,6 +117,8 @@ sub to_bytes { { # 20001114.001 + no utf8; # so that the naked 8-bit character won't gripe under use utf8 + if (ord("Ä") == 0xc4) { # Try to do this only on Latin-1. use charnames ':full'; my $text = "\N{LATIN CAPITAL LETTER A WITH DIAERESIS}"; diff --git a/t/lib/lc-language.t b/t/lib/lc-language.t index 6a70b79ef9..9facd3509d 100644 --- a/t/lib/lc-language.t +++ b/t/lib/lc-language.t @@ -10,6 +10,8 @@ BEGIN { use Locale::Language; +no utf8; # so that the naked 8-bit characters won't gripe under use utf8 + #----------------------------------------------------------------------- # This is an array of tests. Each test is eval'd as an expression. # If it evaluates to FALSE, then "not ok N" is printed for the test, diff --git a/t/pragma/locale.t b/t/pragma/locale.t index 068fedeac8..ecbd80e775 100755 --- a/t/pragma/locale.t +++ b/t/pragma/locale.t @@ -424,8 +424,6 @@ if (-x "/usr/bin/locale" && open(LOCALES, "/usr/bin/locale -a 2>/dev/null|")) { setlocale(LC_ALL, "C"); -sub utf8locale { $_[0] =~ /utf-?8/i } - @Locale = sort @Locale; debug "# Locales = @Locale\n"; @@ -514,16 +512,11 @@ foreach $Locale (@Locale) { # Test \w. - if (utf8locale($Locale)) { - # Until the polymorphic regexen arrive. - debug "# skipping UTF-8 locale '$Locale'\n"; - } else { - my $word = join('', @Neoalpha); + my $word = join('', @Neoalpha); - $word =~ /^(\w+)$/; + $word =~ /^(\w+)$/; - tryneoalpha($Locale, 99, $1 eq $word); - } + tryneoalpha($Locale, 99, $1 eq $word); # Cross-check the whole 8-bit character set. @@ -697,29 +690,26 @@ foreach $Locale (@Locale) { # Does lc of an UPPER (if different from the UPPER) match # case-insensitively the UPPER, and does the UPPER match # case-insensitively the lc of the UPPER. And vice versa. - if (utf8locale($Locale)) { - # Until the polymorphic regexen arrive. - debug "# skipping UTF-8 locale '$Locale'\n"; - } else { - use locale; - - my @f = (); - foreach my $x (keys %UPPER) { - my $y = lc $x; - next unless uc $y eq $x; - push @f, $x unless $x =~ /$y/i && $y =~ /$x/i; - } - foreach my $x (keys %lower) { - my $y = uc $x; - next unless lc $y eq $x; - push @f, $x unless $x =~ /$y/i && $y =~ /$x/i; - } - tryneoalpha($Locale, 116, @f == 0); + { + use locale; + no utf8; # so that the native 8-bit characters work + + my @f = (); + foreach my $x (keys %UPPER) { + my $y = lc $x; + next unless uc $y eq $x; + push @f, $x unless $x =~ /$y/i && $y =~ /$x/i; + } + foreach my $x (keys %lower) { + my $y = uc $x; + next unless lc $y eq $x; + push @f, $x unless $x =~ /$y/i && $y =~ /$x/i; + } + tryneoalpha($Locale, 116, @f == 0); if (@f) { print "# failed 116 locale '$Locale' characters @f\n" } } - } # Recount the errors. -- cgit v1.2.1