#!./perl
#
# all.t - tests for all_* routines in
# Locale::Country
# Locale::Language
# Locale::Currency
# Locale::Script
#
# There are four tests. We get a list of all codes, convert to
# and check that they're the same. Then we do the same,
# starting with list of languages/countries/currencies.
#
BEGIN {
chdir 't' if -d 't';
}
print "1..20\n";
my $code;
my $language;
my $country;
my $ok;
my $reverse;
my $currency;
my $script;
#-----------------------------------------------------------------------
# Old API - without codeset specified, default to ALPHA_2
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# code to country, back to code, for ALPHA2
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# code to country, back to code, for ALPHA3
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# code to country, back to code, for NUMERIC
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# Old API - country to code, back to country, using default of ALPHA_2
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# country to code, back to country, using LOCALE_CODE_ALPHA_2
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# country to code, back to country, using LOCALE_CODE_ALPHA_3
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# country to code, back to country, using LOCALE_CODE_NUMERIC
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
#
# three special cases:
# The Kwacha has two codes - used in Zambia and Malawi
# The Russian Ruble has two codes - rub and rur
# The Belarussian Ruble has two codes - byb and byr
{
$ok = 0;
last;
}
}
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#=======================================================================
#
# Locale::Script tests
#
#=======================================================================
#-----------------------------------------------------------------------
# Old API - without codeset specified, default to ALPHA_2
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# code to script, back to code, for ALPHA2
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# code to script, back to code, for ALPHA3
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# code to script, back to code, for NUMERIC
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# Old API - script to code, back to script, using default of ALPHA_2
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# script to code, back to script, using LOCALE_CODE_ALPHA_2
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# script to code, back to script, using LOCALE_CODE_ALPHA_3
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}
#-----------------------------------------------------------------------
# script to code, back to script, using LOCALE_CODE_NUMERIC
#-----------------------------------------------------------------------
$ok = 1;
{
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
{
$ok = 0;
last;
}
}