From 02764dfe42d9b70f574fcad9db5210a0336d6d8f Mon Sep 17 00:00:00 2001 From: Norbert Lindenberg Date: Sun, 26 Aug 2012 20:49:25 -0700 Subject: =?UTF-8?q?Added=20new=20tests=20for=20chapters=206=20and=209=20of?= =?UTF-8?q?=20ECMAScript=20Internationalization=20API=20Specification.=20-?= =?UTF-8?q?=20Removed=20a=20few=20old=20test=20cases=20that=20were=20redun?= =?UTF-8?q?dant=20with=20new,=20more=20comprehensive=20ones.=20-=20Added?= =?UTF-8?q?=20testIntl.js=20as=20standard=20include=20for=20all=20console?= =?UTF-8?q?=20tests=20in=20test262.py=20=E2=80=93=20see=20related=20bug=20?= =?UTF-8?q?574.=20-=20Added=20.jshintrc=20file=20for=20settings=20for=20th?= =?UTF-8?q?e=20JSHint=20tool.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/suite/intl402/ch06/6.2/6.2.2_a.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/suite/intl402/ch06/6.2/6.2.2_a.js (limited to 'test/suite/intl402/ch06/6.2/6.2.2_a.js') diff --git a/test/suite/intl402/ch06/6.2/6.2.2_a.js b/test/suite/intl402/ch06/6.2/6.2.2_a.js new file mode 100644 index 000000000..144a1e7c9 --- /dev/null +++ b/test/suite/intl402/ch06/6.2/6.2.2_a.js @@ -0,0 +1,34 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that structurally valid language tags are accepted. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var validLanguageTags = [ + "de", // ISO 639 language code + "de-DE", // + ISO 3166-1 country code + "DE-de", // tags are case-insensitive + "cmn", // ISO 639 language code + "cmn-Hans", // + script code + "CMN-hANS", // tags are case-insensitive + "cmn-hans-cn", // + ISO 3166-1 country code + "es-419", // + UN M.49 region code + "es-419-u-nu-latn-cu-bob", // + Unicode locale extension sequence + "i-klingon", // grandfathered tag + "cmn-hans-cn-t-ca-u-ca-x-t-u", // singleton subtags can also be used as private use subtags + "enochian-enochian", // language and variant subtags may be the same + "de-gregory-u-ca-gregory" // variant and extension subtags may be the same +]; + +testWithIntlConstructors(function (Constructor) { + validLanguageTags.forEach(function (tag) { + // this must not throw an exception for a valid language tag + var obj = new Constructor([tag]); + }); + return true; +}); + -- cgit v1.2.1