5 $runtests=shift(@ARGV);
6 if ( -f "t/testfunc.pl" ) {
7 require "t/testfunc.pl";
10 } elsif ( -f "testfunc.pl" ) {
11 require "testfunc.pl";
15 die "ERROR: cannot find testfunc.pl\n";
19 use Locale::Codes::Country;
21 %type = ( "LOCALE_CODE_ALPHA_2" => LOCALE_CODE_ALPHA_2,
22 "LOCALE_CODE_ALPHA_3" => LOCALE_CODE_ALPHA_3,
23 "LOCALE_CODE_NUMERIC" => LOCALE_CODE_NUMERIC,
28 $test[1] = $type{$test[1]} if (@test == 2 && $test[1] && exists $type{$test[1]});
29 return code2country(@test);
40 zz LOCALE_CODE_ALPHA_2 ~ _undef_
42 zz LOCALE_CODE_ALPHA_3 ~ _undef_
44 zz LOCALE_CODE_NUMERIC ~ _undef_
52 Bolivia (Plurinational State of)
57 Bolivia (Plurinational State of)
62 Bolivia (Plurinational State of)
70 United States of America
74 ad LOCALE_CODE_ALPHA_2 ~ Andorra
76 and LOCALE_CODE_ALPHA_3 ~ Andorra
78 020 LOCALE_CODE_NUMERIC ~ Andorra
80 48 LOCALE_CODE_NUMERIC ~ Bahrain
86 United Kingdom of Great Britain and Northern Ireland
92 tl LOCALE_CODE_ALPHA_2 ~ Timor-Leste
94 tls LOCALE_CODE_ALPHA_3 ~ Timor-Leste
96 626 LOCALE_CODE_NUMERIC ~ Timor-Leste
98 BO LOCALE_CODE_ALPHA_3 ~ _undef_
100 BO LOCALE_CODE_NUMERIC ~ _undef_
126 rou LOCALE_CODE_ALPHA_3 ~ Romania
132 jp alpha-2 not_retired other_arg ~ _undef_
136 jp alpha-15 ~ _undef_
138 jp alpha-2 retired ~ Japan
142 print "code2country...\n";
143 test_Func(\&test,$tests,$runtests);
148 # indent-tabs-mode: nil
149 # cperl-indent-level: 3
150 # cperl-continued-statement-offset: 2
151 # cperl-continued-brace-offset: 0
152 # cperl-brace-offset: 0
153 # cperl-brace-imaginary-offset: 0
154 # cperl-label-offset: -2