From: Jarkko Hietaniemi Date: Sat, 1 Dec 2001 20:30:17 +0000 (+0000) Subject: Try to make a missing RADIXCHAR a softer kinder error. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bb5b2f6deaf9e14c2fb7501b3c4cdc60926e42e1;p=p5sagit%2Fp5-mst-13.2.git Try to make a missing RADIXCHAR a softer kinder error. p4raw-id: //depot/perl@13414 --- diff --git a/ext/I18N/Langinfo/Langinfo.t b/ext/I18N/Langinfo/Langinfo.t index b2e97f9..4e14410 100644 --- a/ext/I18N/Langinfo/Langinfo.t +++ b/ext/I18N/Langinfo/Langinfo.t @@ -12,11 +12,17 @@ BEGIN { } } -use I18N::Langinfo qw(langinfo ABDAY_1 DAY_1 ABMON_1 MON_1 RADIXCHAR); +use I18N::Langinfo qw(langinfo ABDAY_1 DAY_1 ABMON_1 MON_1); use POSIX qw(setlocale LC_ALL); use Config; -setlocale(LC_ALL, "C"); +print "# ABDAY_1 = ", ABDAY_1, "\n"; + +eval { I18N::Langinfo->import('RADIXCHAR') }; # silly glibcs +print "# RADIXCHAR = ", RADIXCHAR(), " (eval error = '$@')\n"; +my $has_RADIXCHAR = !$@; + +setlocale(LC_ALL, $ENV{LC_ALL} = $ENV{LANG} = "C"); print "1..5\n"; @@ -32,20 +38,33 @@ print "ok 3\n"; print "not " unless langinfo(MON_1) eq "January"; print "ok 4\n"; -unless (eval { langinfo(RADIXCHAR) } eq ".") { - print "not ok 5 - RADIXCHAR undefined\n"; +my $RADIXCHAR_ok; + +if ($has_RADIXCHAR) { + unless (langinfo(RADIXCHAR()) eq ".") { + print "not ok 5 - RADIXCHAR not '.' under the C locale\n"; + } else { + print "ok 5\n"; + $RADIXCHAR_ok = 1; + } +} else { + print "ok 5 # Skip: you do not have RADIXHCAR\n"; +} + +unless ($RADIXCHAR_ok) { if ($Config{d_gnulibc} || $Config{cppsymbols} =~ /__GNU_LIBRARY_/) { print <