summaryrefslogtreecommitdiff
path: root/test/suite/intl402/ch11/11.2/11.2.2.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/suite/intl402/ch11/11.2/11.2.2.js')
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.2.js33
1 files changed, 13 insertions, 20 deletions
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);
+