Update Locale::Codes to 3.12
[p5sagit/p5-mst-13.2.git] / cpan / Locale-Codes / t / currency2code.t
1 #!/usr/bin/perl -w
2
3 require 5.002;
4
5 $runtests=shift(@ARGV);
6 if ( -f "t/testfunc.pl" ) {
7   require "t/testfunc.pl";
8   $dir="./lib";
9   $tdir="t";
10 } elsif ( -f "testfunc.pl" ) {
11   require "testfunc.pl";
12   $dir="../lib";
13   $tdir=".";
14 } else {
15   die "ERROR: cannot find testfunc.pl\n";
16 }
17
18 unshift(@INC,$dir);
19 use Locale::Currency;
20
21 %type = ( "LOCALE_CODE_ALPHA"    => LOCALE_CODE_ALPHA,
22           "LOCALE_CODE_NUMERIC"  => LOCALE_CODE_NUMERIC,
23         );
24
25 sub test {
26    my(@test) = @_;
27    $test[1]  = $type{$test[1]}
28      if (@test == 2  &&  $test[1]  &&  exists $type{$test[1]});
29    return currency2code(@test);
30 }
31
32 $tests = "
33
34 _blank_ ~ _undef_
35
36 Banana ~ _undef_
37
38 ~ _undef_
39
40 _undef_ ~ _undef_
41
42
43 Canadian Dollar
44    ~
45    CAD
46
47 Kroon
48    ~
49    EEK
50
51 PULA
52    ~
53    BWP
54
55 Riel
56    ~
57    KHR
58
59 Zimbabwe Dollar
60    ~
61    ZWL
62
63 ";
64
65 print "currency2code...\n";
66 test_Func(\&test,$tests,$runtests);
67
68 1;
69 # Local Variables:
70 # mode: cperl
71 # indent-tabs-mode: nil
72 # cperl-indent-level: 3
73 # cperl-continued-statement-offset: 2
74 # cperl-continued-brace-offset: 0
75 # cperl-brace-offset: 0
76 # cperl-brace-imaginary-offset: 0
77 # cperl-label-offset: -2
78 # End: