aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/intl402/ch11
diff options
context:
space:
mode:
Diffstat (limited to 'test/suite/intl402/ch11')
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.1.js32
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.2.js34
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.3.js25
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.js23
-rw-r--r--test/suite/intl402/ch11/11.3/11.3.1.js20
-rw-r--r--test/suite/intl402/ch11/11.3/11.3.js20
6 files changed, 154 insertions, 0 deletions
diff --git a/test/suite/intl402/ch11/11.2/11.2.1.js b/test/suite/intl402/ch11/11.2/11.2.1.js
new file mode 100644
index 000000000..e5ceb08fc
--- /dev/null
+++ b/test/suite/intl402/ch11/11.2/11.2.1.js
@@ -0,0 +1,32 @@
+// Copyright 2012 Google Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @path intl402/ch11/11.2/11.2.1.js
+ * @description Tests that the Intl.Collator prototype object exists and
+ * is not writable, enumerable, or configurable.
+ */
+
+var testcase = function() {
+ "use strict";
+
+ var desc;
+
+ if (!Intl.Collator.hasOwnProperty('prototype')) {
+ $ERROR('Intl.Collator has no prototype property');
+ }
+
+ desc = Object.getOwnPropertyDescriptor(Intl.Collator, 'prototype');
+ if (desc.writable === true) {
+ $ERROR('Intl.Collator.prototype is writable.');
+ }
+ if (desc.enumerable === true) {
+ $ERROR('Intl.Collator.prototype is enumerable.');
+ }
+ if (desc.configurable === true) {
+ $ERROR('Intl.Collator.prototype is configurable.');
+ }
+
+ return true;
+}
+runTestCase(testcase);
diff --git a/test/suite/intl402/ch11/11.2/11.2.2.js b/test/suite/intl402/ch11/11.2/11.2.2.js
new file mode 100644
index 000000000..9d136f77e
--- /dev/null
+++ b/test/suite/intl402/ch11/11.2/11.2.2.js
@@ -0,0 +1,34 @@
+// Copyright 2012 Google Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @path intl402/ch11/11.2/11.2.2.js
+ * @description Tests that the Intl.Collator has a supportedLocalesOf
+ * property, and it works as planned.
+ */
+
+var testcase = function() {
+ "use strict";
+
+ var supported = (new Intl.LocaleList())[0];
+ var notSupported = 'zxx';
+ var requestedLocales = [supported, notSupported];
+
+ var supportedLocales;
+
+ if (!Intl.Collator.hasOwnProperty('supportedLocalesOf')) {
+ $ERROR("Intl.Collator doesn't have a supportedLocalesOf property.");
+ }
+
+ supportedLocales = Intl.Collator.supportedLocalesOf(requestedLocales);
+ if (supportedLocales.length !== 1) {
+ $ERROR('The length of supported locales list is not 1.');
+ }
+
+ if (supportedLocales[0] !== supported) {
+ $ERROR('The supported locale is not returned in the supported list.');
+ }
+
+ return true;
+}
+runTestCase(testcase);
diff --git a/test/suite/intl402/ch11/11.2/11.2.3.js b/test/suite/intl402/ch11/11.2/11.2.3.js
new file mode 100644
index 000000000..98ee05b9b
--- /dev/null
+++ b/test/suite/intl402/ch11/11.2/11.2.3.js
@@ -0,0 +1,25 @@
+// Copyright 2012 Google Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @path intl402/ch11/11.2/11.2.3.js
+ * @description Tests the internal properties of Intl.NumberFormat
+ */
+
+var testcase = function() {
+ "use strict";
+
+ var defaultLocale = (new Intl.LocaleList())[0];
+ var supportedLocales = Intl.Collator.supportedLocalesOf([defaultLocale]);
+
+ if (supportedLocales.length < 1 || supportedLocales[0] != defaultLocale) {
+ $ERROR('The default Locale is not supported by Intl.Collator');
+ }
+
+ // FIXME: Find a way to check that [[relevantExtensionKeys]] === ['nu']
+
+ // FIXME: Find a way to check specified properties of [[localeData]]
+
+ return true;
+}
+runTestCase(testcase);
diff --git a/test/suite/intl402/ch11/11.2/11.2.js b/test/suite/intl402/ch11/11.2/11.2.js
new file mode 100644
index 000000000..a79f75af3
--- /dev/null
+++ b/test/suite/intl402/ch11/11.2/11.2.js
@@ -0,0 +1,23 @@
+// Copyright 2012 Google Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @path intl402/ch11/11.2/11.2.js
+ * @description Tests that the Intl.Collator constructor has a length
+ * property that equals 2.
+ */
+
+var testcase = function() {
+ "use strict";
+
+ if (!Intl.Collator.hasOwnProperty('length')) {
+ $ERROR('Intl.Collator has no length property');
+ }
+
+ if (Intl.Collator.length != 2) {
+ $ERROR('Intl.Collator.length is not 2.');
+ }
+
+ return true;
+}
+runTestCase(testcase);
diff --git a/test/suite/intl402/ch11/11.3/11.3.1.js b/test/suite/intl402/ch11/11.3/11.3.1.js
new file mode 100644
index 000000000..2ca03c726
--- /dev/null
+++ b/test/suite/intl402/ch11/11.3/11.3.1.js
@@ -0,0 +1,20 @@
+// Copyright 2012 Google Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @path intl402/ch11/11.3/11.3.1.js
+ * @description Tests that Intl.Collator.prototype.constructor is the
+ * Intl.Collator.
+ */
+
+var testcase = function() {
+ "use strict";
+
+ if (Intl.Collator.prototype.constructor !== Intl.Collator) {
+ $ERROR("Intl.Collator.prototype.constructor is not the same as " +
+ "Intl.Collator");
+ }
+
+ return true;
+}
+runTestCase(testcase);
diff --git a/test/suite/intl402/ch11/11.3/11.3.js b/test/suite/intl402/ch11/11.3/11.3.js
new file mode 100644
index 000000000..9ea63b92b
--- /dev/null
+++ b/test/suite/intl402/ch11/11.3/11.3.js
@@ -0,0 +1,20 @@
+// Copyright 2012 Google Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @path intl402/ch11/11.3/11.3.js
+ * @description Tests that Intl.Collator.prototype is an intance of
+ * Intl.Collator.
+ */
+
+var testcase = function() {
+ "use strict";
+
+ if (!(Intl.Collator.prototype instanceof Intl.Collator)) {
+ $ERROR("Intl.Collator's prototype is not an instance of " +
+ "Intl.Collator");
+ }
+
+ return true;
+}
+runTestCase(testcase);