js/src/tests/test262/intl402/ch06/6.2/6.2.2_a.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // Copyright 2012 Mozilla Corporation. All rights reserved.
     2 // This code is governed by the BSD license found in the LICENSE file.
     4 /**
     5  * @description Tests that structurally valid language tags are accepted.
     6  * @author Norbert Lindenberg
     7  */
     9 $INCLUDE("testIntl.js");
    11 var validLanguageTags = [
    12     "de", // ISO 639 language code
    13     "de-DE", // + ISO 3166-1 country code
    14     "DE-de", // tags are case-insensitive
    15     "cmn", // ISO 639 language code
    16     "cmn-Hans", // + script code
    17     "CMN-hANS", // tags are case-insensitive
    18     "cmn-hans-cn", // + ISO 3166-1 country code
    19     "es-419", // + UN M.49 region code
    20     "es-419-u-nu-latn-cu-bob", // + Unicode locale extension sequence
    21     "i-klingon", // grandfathered tag
    22     "cmn-hans-cn-t-ca-u-ca-x-t-u", // singleton subtags can also be used as private use subtags
    23     "enochian-enochian", // language and variant subtags may be the same
    24     "de-gregory-u-ca-gregory", // variant and extension subtags may be the same
    25     "aa-a-foo-x-a-foo-bar", // variant subtags can also be used as private use subtags
    26     "x-en-US-12345", // anything goes in private use tags
    27     "x-12345-12345-en-US",
    28     "x-en-US-12345-12345",
    29     "x-en-u-foo",
    30     "x-en-u-foo-u-bar"
    31 ];
    33 testWithIntlConstructors(function (Constructor) {
    34     validLanguageTags.forEach(function (tag) {
    35         // this must not throw an exception for a valid language tag
    36         var obj = new Constructor([tag]);
    37     });
    38     return true;
    39 });

mercurial