aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNorbert Lindenberg <ecmascript@lindenbergsoftware.com>2012-09-10 11:53:56 -0700
committerNorbert Lindenberg <ecmascript@lindenbergsoftware.com>2012-09-10 11:53:56 -0700
commit75fbd71ee0a39c76cf035e744dc28e408bff7c6f (patch)
tree96d6e4c14b410aea94ed1c63d16636ec8ce225d0 /test
parentbcf9c18061df63a233d01a0ea191c0b1135c42a4 (diff)
Updated tests for ECMAScript Internationalization API spec changes; made small enhancements.
- Updated DateTimeFormat tests for new handling of hour12 options property. - Added a few invalid language tags to test of IsStructurallyValidLanguageTag. - Added user-defined language tag to test of CanonicalizeLanguageTag. - Added test for the Intl property of the global object.
Diffstat (limited to 'test')
-rw-r--r--test/harness/testBuiltInObject.js3
-rw-r--r--test/suite/intl402/ch06/6.2/6.2.2_c.js2
-rw-r--r--test/suite/intl402/ch06/6.2/6.2.3.js3
-rw-r--r--test/suite/intl402/ch08/8.0/8.0_L15.js1
-rw-r--r--test/suite/intl402/ch12/12.1/12.1.1_18.js5
-rw-r--r--test/suite/intl402/ch12/12.3/12.3.3.js2
6 files changed, 12 insertions, 4 deletions
diff --git a/test/harness/testBuiltInObject.js b/test/harness/testBuiltInObject.js
index e8eb39c67..3a8d24fdc 100644
--- a/test/harness/testBuiltInObject.js
+++ b/test/harness/testBuiltInObject.js
@@ -58,7 +58,8 @@ function testBuiltInObject(obj, isFunction, isConstructor, properties, length) {
}
if (obj.length !== length) {
- $ERROR("Function's length property doesn't have specified value.");
+ $ERROR("Function's length property doesn't have specified value; expected " +
+ length + ", got " + obj.length + ".");
}
var desc = Object.getOwnPropertyDescriptor(obj, "length");
diff --git a/test/suite/intl402/ch06/6.2/6.2.2_c.js b/test/suite/intl402/ch06/6.2/6.2.2_c.js
index ff2f9ae95..6d669ebef 100644
--- a/test/suite/intl402/ch06/6.2/6.2.2_c.js
+++ b/test/suite/intl402/ch06/6.2/6.2.2_c.js
@@ -20,6 +20,8 @@ var invalidLanguageTags = [
"cmn-hans-cn-u-u", // duplicate singleton
"cmn-hans-cn-t-u-ca-u", // duplicate singleton
"de-gregory-gregory", // duplicate variant
+ "*", // language range
+ "de-*", // language range
"中文", // non-ASCII letters
"en-ß", // non-ASCII letters
"ıd" // non-ASCII letters
diff --git a/test/suite/intl402/ch06/6.2/6.2.3.js b/test/suite/intl402/ch06/6.2/6.2.3.js
index ce273e198..4ae15ab27 100644
--- a/test/suite/intl402/ch06/6.2/6.2.3.js
+++ b/test/suite/intl402/ch06/6.2/6.2.3.js
@@ -29,7 +29,8 @@ var canonicalizedTags = {
"de-DD": ["de-DE", "de"],
"zh-hak-CN": ["hak-CN", "hak"],
"sgn-ils": ["ils"],
- "in": ["id"]
+ "in": ["id"],
+ "x-foo": ["x-foo"]
};
// make sure the data above is correct
diff --git a/test/suite/intl402/ch08/8.0/8.0_L15.js b/test/suite/intl402/ch08/8.0/8.0_L15.js
index 9b0b63952..0174bef54 100644
--- a/test/suite/intl402/ch08/8.0/8.0_L15.js
+++ b/test/suite/intl402/ch08/8.0/8.0_L15.js
@@ -10,5 +10,6 @@
$INCLUDE("testBuiltInObject.js");
+testBuiltInObject(fnGlobalObject().Intl, false, false, []);
testBuiltInObject(Intl, false, false, ["Collator", "NumberFormat", "DateTimeFormat"]);
diff --git a/test/suite/intl402/ch12/12.1/12.1.1_18.js b/test/suite/intl402/ch12/12.1/12.1.1_18.js
index e061c0daf..f75ea1e32 100644
--- a/test/suite/intl402/ch12/12.1/12.1.1_18.js
+++ b/test/suite/intl402/ch12/12.1/12.1.1_18.js
@@ -8,5 +8,8 @@
$INCLUDE("testIntl.js");
-testOption(Intl.DateTimeFormat, "hour12", "boolean");
+testOption(Intl.DateTimeFormat, "hour12", "boolean", undefined, undefined,
+ {extra: {any: {hour: "numeric", minute: "numeric"}}});
+testOption(Intl.DateTimeFormat, "hour12", "boolean", undefined, undefined,
+ {noReturn: true});
diff --git a/test/suite/intl402/ch12/12.3/12.3.3.js b/test/suite/intl402/ch12/12.3/12.3.3.js
index f5a9f688a..b5735c350 100644
--- a/test/suite/intl402/ch12/12.3/12.3.3.js
+++ b/test/suite/intl402/ch12/12.3/12.3.3.js
@@ -39,7 +39,6 @@ mustHaveProperty(actual, "locale", isCanonicalizedStructurallyValidLanguageTag);
mustHaveProperty(actual, "calendar", calendars);
mustHaveProperty(actual, "numberingSystem", isValidNumberingSystem);
mustHaveProperty(actual, "timeZone", [undefined]);
-mustHaveProperty(actual, "hour12", [true, false]);
mustNotHaveProperty(actual, "weekday");
mustNotHaveProperty(actual, "era");
mustHaveProperty(actual, "year", ["2-digit", "numeric"]);
@@ -49,4 +48,5 @@ mustNotHaveProperty(actual, "hour");
mustNotHaveProperty(actual, "minute");
mustNotHaveProperty(actual, "second");
mustNotHaveProperty(actual, "timeZoneName");
+mustNotHaveProperty(actual, "hour12");