1require 5;
2 # Time-stamp: "2004-10-06 23:07:06 ADT"
3use strict;
4use Test;
5BEGIN { plan tests => 22 };
6BEGIN { ok 1 }
7use I18N::LangTags (':ALL');
8
9print "# Perl v$], I18N::LangTags v$I18N::LangTags::VERSION\n";
10print "#  Loaded from ", $INC{'I18N/LangTags.pm'} || "??", "\n";
11
12ok lc locale2language_tag('en'),    'en';
13ok lc locale2language_tag('en_US'),    'en-us';
14ok lc locale2language_tag('en_US.ISO8859-1'),    'en-us';
15ok lc(locale2language_tag('C')||''),    '';
16ok lc(locale2language_tag('POSIX')||''), '';
17
18
19ok lc locale2language_tag('eu_mt'),           'eu-mt';
20ok lc locale2language_tag('eu'),              'eu';
21ok lc locale2language_tag('it'),              'it';
22ok lc locale2language_tag('it_IT'),           'it-it';
23ok lc locale2language_tag('it_IT.utf8'),      'it-it';
24ok lc locale2language_tag('it_IT.utf8@euro'), 'it-it';
25ok lc locale2language_tag('it_IT@euro'),      'it-it';
26
27
28ok lc locale2language_tag('zh_CN.gb18030'), 'zh-cn';
29ok lc locale2language_tag('zh_CN.gbk'),     'zh-cn';
30ok lc locale2language_tag('zh_CN.utf8'),    'zh-cn';
31ok lc locale2language_tag('zh_HK'),         'zh-hk';
32ok lc locale2language_tag('zh_HK.utf8'),    'zh-hk';
33ok lc locale2language_tag('zh_TW'),         'zh-tw';
34ok lc locale2language_tag('zh_TW.euctw'),   'zh-tw';
35ok lc locale2language_tag('zh_TW.utf8'),    'zh-tw';
36
37print "# So there!\n";
38ok 1;
39