summaryrefslogtreecommitdiff
path: root/test/suite/intl402/ch11/11.2
diff options
context:
space:
mode:
Diffstat (limited to 'test/suite/intl402/ch11/11.2')
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.1.js27
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.2.js33
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.3.js23
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.js15
4 files changed, 35 insertions, 63 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
index e5ceb08fc..6583bed08 100644
--- a/test/suite/intl402/ch11/11.2/11.2.1.js
+++ b/test/suite/intl402/ch11/11.2/11.2.1.js
@@ -2,31 +2,24 @@
// 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;
- var desc;
-
- if (!Intl.Collator.hasOwnProperty('prototype')) {
+if (!Intl.Collator.hasOwnProperty('prototype')) {
$ERROR('Intl.Collator has no prototype property');
- }
+}
- desc = Object.getOwnPropertyDescriptor(Intl.Collator, 'prototype');
- if (desc.writable === true) {
+desc = Object.getOwnPropertyDescriptor(Intl.Collator, 'prototype');
+if (desc.writable === true) {
$ERROR('Intl.Collator.prototype is writable.');
- }
- if (desc.enumerable === true) {
+}
+if (desc.enumerable === true) {
$ERROR('Intl.Collator.prototype is enumerable.');
- }
- if (desc.configurable === true) {
+}
+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
index 9d136f77e..5cf953ce8 100644
--- a/test/suite/intl402/ch11/11.2/11.2.2.js
+++ b/test/suite/intl402/ch11/11.2/11.2.2.js
@@ -2,33 +2,26 @@
// 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
+ * @description Tests that Intl.Collator has a supportedLocalesOf
* property, and it works as planned.
*/
-var testcase = function() {
- "use strict";
+var defaultLocale = new Intl.Collator().resolvedOptions().locale;
+var notSupported = 'zxx'; // "no linguistic content"
+var requestedLocales = [defaultLocale, notSupported];
- var supported = (new Intl.LocaleList())[0];
- var notSupported = 'zxx';
- var requestedLocales = [supported, notSupported];
+var supportedLocales;
- var supportedLocales;
-
- if (!Intl.Collator.hasOwnProperty('supportedLocalesOf')) {
+if (!Intl.Collator.hasOwnProperty('supportedLocalesOf')) {
$ERROR("Intl.Collator doesn't have a supportedLocalesOf property.");
- }
+}
- supportedLocales = Intl.Collator.supportedLocalesOf(requestedLocales);
- if (supportedLocales.length !== 1) {
+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;
+if (supportedLocales[0] !== defaultLocale) {
+ $ERROR('The default locale is not returned in the supported list.');
}
-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
index 98ee05b9b..c281491a0 100644
--- a/test/suite/intl402/ch11/11.2/11.2.3.js
+++ b/test/suite/intl402/ch11/11.2/11.2.3.js
@@ -2,24 +2,17 @@
// 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
+ * @description Tests the internal properties of Intl.Collator.
*/
-var testcase = function() {
- "use strict";
+var defaultLocale = new Intl.Collator([]).resolvedOptions().locale;
+var supportedLocales = Intl.Collator.supportedLocalesOf([defaultLocale]);
- 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');
- }
+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 [[relevantExtensionKeys]]
- // FIXME: Find a way to check specified properties of [[localeData]]
+// 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
index a79f75af3..2a9c073e9 100644
--- a/test/suite/intl402/ch11/11.2/11.2.js
+++ b/test/suite/intl402/ch11/11.2/11.2.js
@@ -2,22 +2,15 @@
// 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')) {
+if (!Intl.Collator.hasOwnProperty('length')) {
$ERROR('Intl.Collator has no length property');
- }
+}
- if (Intl.Collator.length != 2) {
+if (Intl.Collator.length != 2) {
$ERROR('Intl.Collator.length is not 2.');
- }
-
- return true;
}
-runTestCase(testcase);
+