This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove all space optimisations from SV body structures.
[perl5.git] / dist / I18N-LangTags / t / 20_locales.t
1 require 5;
2  # Time-stamp: "2004-10-06 23:07:06 ADT"
3 use strict;
4 use Test;
5 BEGIN { plan tests => 22 };
6 BEGIN { ok 1 }
7 use I18N::LangTags (':ALL');
8
9 print "# Perl v$], I18N::LangTags v$I18N::LangTags::VERSION\n";
10 print "#  Loaded from ", $INC{'I18N/LangTags.pm'} || "??", "\n";
11
12 ok lc locale2language_tag('en'),    'en';
13 ok lc locale2language_tag('en_US'),    'en-us';
14 ok lc locale2language_tag('en_US.ISO8859-1'),    'en-us';
15 ok lc(locale2language_tag('C')||''),    '';
16 ok lc(locale2language_tag('POSIX')||''), '';
17
18
19 ok lc locale2language_tag('eu_mt'),           'eu-mt';
20 ok lc locale2language_tag('eu'),              'eu';
21 ok lc locale2language_tag('it'),              'it';
22 ok lc locale2language_tag('it_IT'),           'it-it';
23 ok lc locale2language_tag('it_IT.utf8'),      'it-it';
24 ok lc locale2language_tag('it_IT.utf8@euro'), 'it-it';
25 ok lc locale2language_tag('it_IT@euro'),      'it-it';
26
27
28 ok lc locale2language_tag('zh_CN.gb18030'), 'zh-cn';
29 ok lc locale2language_tag('zh_CN.gbk'),     'zh-cn';
30 ok lc locale2language_tag('zh_CN.utf8'),    'zh-cn';
31 ok lc locale2language_tag('zh_HK'),         'zh-hk';
32 ok lc locale2language_tag('zh_HK.utf8'),    'zh-hk';
33 ok lc locale2language_tag('zh_TW'),         'zh-tw';
34 ok lc locale2language_tag('zh_TW.euctw'),   'zh-tw';
35 ok lc locale2language_tag('zh_TW.utf8'),    'zh-tw';
36
37 print "# So there!\n";
38 ok 1;