Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | // Copyright 2012 Mozilla Corporation. All rights reserved. |
michael@0 | 2 | // This code is governed by the license found in the LICENSE file. |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * @description Tests that the object returned by Intl.Collator.prototype.resolvedOptions |
michael@0 | 6 | * has the right properties. |
michael@0 | 7 | * @author Norbert Lindenberg |
michael@0 | 8 | */ |
michael@0 | 9 | |
michael@0 | 10 | $INCLUDE("testIntl.js"); |
michael@0 | 11 | |
michael@0 | 12 | var actual = new Intl.Collator().resolvedOptions(); |
michael@0 | 13 | |
michael@0 | 14 | var actual2 = new Intl.Collator().resolvedOptions(); |
michael@0 | 15 | if (actual2 === actual) { |
michael@0 | 16 | $ERROR("resolvedOptions returned the same object twice."); |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | // source: CLDR file common/bcp47/collation.xml; version CLDR 21. |
michael@0 | 20 | var collations = [ |
michael@0 | 21 | "default", // added |
michael@0 | 22 | "big5han", |
michael@0 | 23 | "dict", |
michael@0 | 24 | "direct", |
michael@0 | 25 | "ducet", |
michael@0 | 26 | "gb2312", |
michael@0 | 27 | "phonebk", |
michael@0 | 28 | "phonetic", |
michael@0 | 29 | "pinyin", |
michael@0 | 30 | "reformed", |
michael@0 | 31 | // "search", // excluded |
michael@0 | 32 | "searchjl", |
michael@0 | 33 | // "standard", // excluded |
michael@0 | 34 | "stroke", |
michael@0 | 35 | "trad", |
michael@0 | 36 | "unihan" |
michael@0 | 37 | ]; |
michael@0 | 38 | |
michael@0 | 39 | // this assumes the default values where the specification provides them |
michael@0 | 40 | mustHaveProperty(actual, "locale", isCanonicalizedStructurallyValidLanguageTag); |
michael@0 | 41 | mustHaveProperty(actual, "usage", ["sort"]); |
michael@0 | 42 | mustHaveProperty(actual, "sensitivity", ["variant"]); |
michael@0 | 43 | mustHaveProperty(actual, "ignorePunctuation", [false]); |
michael@0 | 44 | mustHaveProperty(actual, "collation", collations); |
michael@0 | 45 | mayHaveProperty(actual, "numeric", [true, false]); |
michael@0 | 46 | mayHaveProperty(actual, "caseFirst", ["upper", "lower", "false"]); |
michael@0 | 47 |