From: Nicholas Clark Date: Sun, 31 Oct 2004 11:07:57 +0000 (+0000) Subject: Oops. Forgot to add the new test in I18N::LangTags 0.35 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=91d43147e4cecfbf37e858760e10b3a1bf877cd7;p=p5sagit%2Fp5-mst-13.2.git Oops. Forgot to add the new test in I18N::LangTags 0.35 p4raw-id: //depot/perl@23442 --- diff --git a/lib/I18N/LangTags/t/20_locales.t b/lib/I18N/LangTags/t/20_locales.t new file mode 100644 index 0000000..ae04812 --- /dev/null +++ b/lib/I18N/LangTags/t/20_locales.t @@ -0,0 +1,38 @@ +require 5; + # Time-stamp: "2004-10-06 23:07:06 ADT" +use strict; +use Test; +BEGIN { plan tests => 22 }; +BEGIN { ok 1 } +use I18N::LangTags (':ALL'); + +print "# Perl v$], I18N::LangTags v$I18N::LangTags::VERSION\n"; +print "# Loaded from ", $INC{'I18N/LangTags.pm'} || "??", "\n"; + +ok lc locale2language_tag('en'), 'en'; +ok lc locale2language_tag('en_US'), 'en-us'; +ok lc locale2language_tag('en_US.ISO8859-1'), 'en-us'; +ok lc(locale2language_tag('C')||''), ''; +ok lc(locale2language_tag('POSIX')||''), ''; + + +ok lc locale2language_tag('eu_mt'), 'eu-mt'; +ok lc locale2language_tag('eu'), 'eu'; +ok lc locale2language_tag('it'), 'it'; +ok lc locale2language_tag('it_IT'), 'it-it'; +ok lc locale2language_tag('it_IT.utf8'), 'it-it'; +ok lc locale2language_tag('it_IT.utf8@euro'), 'it-it'; +ok lc locale2language_tag('it_IT@euro'), 'it-it'; + + +ok lc locale2language_tag('zh_CN.gb18030'), 'zh-cn'; +ok lc locale2language_tag('zh_CN.gbk'), 'zh-cn'; +ok lc locale2language_tag('zh_CN.utf8'), 'zh-cn'; +ok lc locale2language_tag('zh_HK'), 'zh-hk'; +ok lc locale2language_tag('zh_HK.utf8'), 'zh-hk'; +ok lc locale2language_tag('zh_TW'), 'zh-tw'; +ok lc locale2language_tag('zh_TW.euctw'), 'zh-tw'; +ok lc locale2language_tag('zh_TW.utf8'), 'zh-tw'; + +print "# So there!\n"; +ok 1;