diff options
Diffstat (limited to 'test/suite/intl402/ch13/13.2')
-rw-r--r-- | test/suite/intl402/ch13/13.2/13.2.1.js | 27 | ||||
-rw-r--r-- | test/suite/intl402/ch13/13.2/13.2.2.js | 33 | ||||
-rw-r--r-- | test/suite/intl402/ch13/13.2/13.2.3.js | 25 | ||||
-rw-r--r-- | test/suite/intl402/ch13/13.2/13.2.js | 15 |
4 files changed, 36 insertions, 64 deletions
diff --git a/test/suite/intl402/ch13/13.2/13.2.1.js b/test/suite/intl402/ch13/13.2/13.2.1.js index c5a7b1967..4ec28c5d3 100644 --- a/test/suite/intl402/ch13/13.2/13.2.1.js +++ b/test/suite/intl402/ch13/13.2/13.2.1.js @@ -2,32 +2,25 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * @path intl402/ch13/13.2/13.2.1.js * @description Tests that the Intl.DateTimeFormat prototype object exists and * is not writable, enumerable, or configurable. * @author: Roozbeh Pournader */ -var testcase = function() { - "use strict"; +var desc; - var desc; - - if (!Intl.DateTimeFormat.hasOwnProperty('prototype')) { +if (!Intl.DateTimeFormat.hasOwnProperty('prototype')) { $ERROR('Intl.DateTimeFormat has no prototype property'); - } +} - desc = Object.getOwnPropertyDescriptor(Intl.DateTimeFormat, 'prototype'); - if (desc.writable === true) { +desc = Object.getOwnPropertyDescriptor(Intl.DateTimeFormat, 'prototype'); +if (desc.writable === true) { $ERROR('Intl.DateTimeFormat.prototype is writable.'); - } - if (desc.enumerable === true) { +} +if (desc.enumerable === true) { $ERROR('Intl.DateTimeFormat.prototype is enumerable.'); - } - if (desc.configurable === true) { +} +if (desc.configurable === true) { $ERROR('Intl.DateTimeFormat.prototype is configurable.'); - } - - return true; } -runTestCase(testcase); + diff --git a/test/suite/intl402/ch13/13.2/13.2.2.js b/test/suite/intl402/ch13/13.2/13.2.2.js index 9bcfa54f6..42eedc0a1 100644 --- a/test/suite/intl402/ch13/13.2/13.2.2.js +++ b/test/suite/intl402/ch13/13.2/13.2.2.js @@ -2,34 +2,27 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * @path intl402/ch13/13.2/13.2.2.js - * @description Tests that the Intl.DateTimeFormat has a supportedLocalesOf + * @description Tests that Intl.DateTimeFormat has a supportedLocalesOf * property, and it works as planned. * @author: Roozbeh Pournader */ -var testcase = function() { - "use strict"; - - var supported = (new Intl.LocaleList())[0]; - var notSupported = 'zxx'; - var requestedLocales = [supported, notSupported]; +var defaultLocale = new Intl.DateTimeFormat().resolvedOptions().locale; +var notSupported = 'zxx'; // "no linguistic content" +var requestedLocales = [defaultLocale, notSupported]; - var supportedLocales; +var supportedLocales; - if (!Intl.DateTimeFormat.hasOwnProperty('supportedLocalesOf')) { +if (!Intl.DateTimeFormat.hasOwnProperty('supportedLocalesOf')) { $ERROR("Intl.DateTimeFormat doesn't have a supportedLocalesOf property."); - } +} - supportedLocales = Intl.DateTimeFormat.supportedLocalesOf(requestedLocales); - if (supportedLocales.length !== 1) { +supportedLocales = Intl.DateTimeFormat.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/ch13/13.2/13.2.3.js b/test/suite/intl402/ch13/13.2/13.2.3.js index 56f9eadf5..333d97ae8 100644 --- a/test/suite/intl402/ch13/13.2/13.2.3.js +++ b/test/suite/intl402/ch13/13.2/13.2.3.js @@ -2,25 +2,18 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * @path intl402/ch13/13.2/13.2.3.js - * @description Tests the internal properties of Intl.DateTimeFormat + * @description Tests the internal properties of Intl.DateTimeFormat. * @author: Roozbeh Pournader */ -var testcase = function() { - "use strict"; - - var defaultLocale = (new Intl.LocaleList())[0]; - var supportedLocales = Intl.DateTimeFormat.supportedLocalesOf([defaultLocale]); +var defaultLocale = new Intl.DateTimeFormat([]).resolvedOptions().locale; +var supportedLocales = Intl.DateTimeFormat.supportedLocalesOf([defaultLocale]); - if (supportedLocales.length < 1 || supportedLocales[0] != defaultLocale) { - $ERROR('The default Locale is not supported by Intl.DateTimeFormat'); - } +if (supportedLocales.length < 1 || supportedLocales[0] !== defaultLocale) { + $ERROR('The default locale is not supported by Intl.DateTimeFormat'); +} - // FIXME: Find a way to check that [[relevantExtensionKeys]] === ['ca', 'nu'] - - // FIXME: Find a way to check specified properties of [[localeData]] +// FIXME: Find a way to check that [[relevantExtensionKeys]] === ['ca', 'nu'] - return true; -} -runTestCase(testcase); +// FIXME: Find a way to check specified properties of [[localeData]] + diff --git a/test/suite/intl402/ch13/13.2/13.2.js b/test/suite/intl402/ch13/13.2/13.2.js index e58ac5dc4..59785479a 100644 --- a/test/suite/intl402/ch13/13.2/13.2.js +++ b/test/suite/intl402/ch13/13.2/13.2.js @@ -2,23 +2,16 @@ // This code is governed by the BSD license found in the LICENSE file. /** - * @path intl402/ch13/13.2/13.2.js * @description Tests that the Intl.DateTimeFormat constructor has a length * property that equals 2. * @author: Roozbeh Pournader */ -var testcase = function() { - "use strict"; - - if (!Intl.DateTimeFormat.hasOwnProperty('length')) { +if (!Intl.DateTimeFormat.hasOwnProperty('length')) { $ERROR('Intl.DateTimeFormat has no length property'); - } +} - if (Intl.DateTimeFormat.length != 2) { +if (Intl.DateTimeFormat.length != 2) { $ERROR('Intl.DateTimeFormat.length is not 2.'); - } - - return true; } -runTestCase(testcase); + |