#!./perl -wT
+use strict;
+use warnings;
+
# This tests plain 'use locale' and adorned 'use locale ":not_characters"'
# Because these pragmas are compile time, and I (khw) am trying to test
# without using 'eval' as much as possible, which might cloud the issue, the
require Config; import Config;
}
-use strict;
use feature 'fc';
# =1 adds debugging output; =2 increases the verbosity somewhat
irix => qr/ ^ (?: cs | hu | sk ) $/x,
darwin => qr/ ^ lt_LT.ISO8859 /ix,
os390 => qr/ ^ italian /ix,
+ netbsd => qr/\bISO8859-2\b/i,
+
+ # This may be the same bug as the cygwin below; it's
+ # generating malformed UTF-8 on the radix being
+ # mulit-byte
+ solaris => qr/ ^ ( ar_ | pa_ ) /x,
);
# cygwin isn't returning proper radix length in this locale, but supposedly to
my $first_c_test = $locales_test_number;
$test_names{++$locales_test_number} = 'Verify that a different locale radix works when doing "==" with a constant';
- if ($Config{usequadmath}) {
- print "# Skip: no locale radix with usequadmath ($test_names{$locales_test_number})\n";
- report_result($Locale, $locales_test_number, 1);
- } else {
- report_result($Locale, $locales_test_number, $ok3);
- $problematical_tests{$locales_test_number} = 1;
- }
+ report_result($Locale, $locales_test_number, $ok3);
+ $problematical_tests{$locales_test_number} = 1;
$test_names{++$locales_test_number} = 'Verify that a different locale radix works when doing "==" with a scalar';
- if ($Config{usequadmath}) {
- print "# Skip: no locale radix with usequadmath ($test_names{$locales_test_number})\n";
- report_result($Locale, $locales_test_number, 1);
- } else {
- report_result($Locale, $locales_test_number, $ok4);
- $problematical_tests{$locales_test_number} = 1;
- }
+ report_result($Locale, $locales_test_number, $ok4);
+ $problematical_tests{$locales_test_number} = 1;
report_result($Locale, ++$locales_test_number, $ok5);
$test_names{$locales_test_number} = 'Verify that a different locale radix works when doing "==" with a scalar and an intervening sprintf';
$test_names{$locales_test_number} = 'Verify that "==" with a scalar still works in inner no locale';
$test_names{++$locales_test_number} = 'Verify that "==" with a scalar and an intervening sprintf still works in inner no locale';
- if ($Config{usequadmath}) {
- print "# Skip: no locale radix with usequadmath ($test_names{$locales_test_number})\n";
- report_result($Locale, $locales_test_number, 1);
- } else {
- report_result($Locale, $locales_test_number, $ok8);
- $problematical_tests{$locales_test_number} = 1;
- }
+ report_result($Locale, $locales_test_number, $ok8);
+ $problematical_tests{$locales_test_number} = 1;
debug "$first_e_test..$locales_test_number: \$e = $e, no locale\n";
$problematical_tests{$locales_test_number} = 1;
$test_names{++$locales_test_number} = 'Verify that after a no-locale block, a different locale radix still works when doing "==" with a scalar and an intervening sprintf';
- if ($Config{usequadmath}) {
- print "# Skip: no locale radix with usequadmath ($test_names{$locales_test_number})\n";
- report_result($Locale, $locales_test_number, 1);
- } else {
- report_result($Locale, $locales_test_number, $ok11);
- $problematical_tests{$locales_test_number} = 1;
- }
+ report_result($Locale, $locales_test_number, $ok11);
+ $problematical_tests{$locales_test_number} = 1;
report_result($Locale, ++$locales_test_number, $ok12);
$test_names{$locales_test_number} = 'Verify that after a no-locale block, a different locale radix can participate in an addition and function call as numeric';
report_result($Locale, ++$locales_test_number, $ok15);
$test_names{$locales_test_number} = 'Verify that a number with a UTF-8 radix has a UTF-8 stringification';
+ $problematical_tests{$locales_test_number} = 1;
report_result($Locale, ++$locales_test_number, $ok16);
$test_names{$locales_test_number} = 'Verify that a sprintf of a number with a UTF-8 radix yields UTF-8';
# OS X 10.9.3
report_result($Locale, ++$locales_test_number, $ok21);
- $test_names{$locales_test_number} = '"$!" is ASCII only outside of locale scope';
+ $test_names{$locales_test_number} = '"$!" is ASCII-only outside of locale scope';
debug "$first_f_test..$locales_test_number: \$f = $f, \$g = $g, back to locale = $Locale\n";
}
}
- if ($Config{usequadmath}) {
- print "# Skip: no locale radix with usequadmath ($Locale)\n";
- report_result($Locale, $locales_test_number, 1);
- } else {
- report_result($Locale, $locales_test_number, @f == 0);
- if (@f) {
- print "# failed $locales_test_number locale '$Locale' numbers @f\n"
- }
+ report_result($Locale, $locales_test_number, @f == 0);
+ if (@f) {
+ print "# failed $locales_test_number locale '$Locale' numbers @f\n"
}
}
}
$test_num = $final_locales_test_number;
-unless ( $os =~ m!^(dragonfly|openbsd|bitrig|mirbsd)$! ) {
+if ( ! defined $Config{d_setlocale_accepts_any_locale_name}) {
# perl #115808
use warnings;
my $warned = 0;
$warned = $_[0] =~ /uninitialized/;
};
my $z = "y" . setlocale(&POSIX::LC_ALL, "xyzzy");
- ok($warned, "variable set to setlocale(BAD LOCALE) is considered uninitialized");
+ ok($warned, "variable set to setlocale(\"invalid locale name\") is considered uninitialized");
}
# Test that tainting and case changing works on utf8 strings. These tests are