diff options
author | Norbert Lindenberg <ecmascript@lindenbergsoftware.com> | 2012-08-22 17:53:26 -0700 |
---|---|---|
committer | Norbert Lindenberg <ecmascript@lindenbergsoftware.com> | 2012-08-22 17:53:26 -0700 |
commit | b8c591008f671c8675d46e60c39704d9098811a7 (patch) | |
tree | 2209cc34ae5caca04afaeadbf7483c7d2c2d8065 /test/suite/intl402/ch11/11.2/11.2.2.js | |
parent | ccbb3ad3c0433311c7d4032441dcd0f0c24d1025 (diff) | |
download | test262-b8c591008f671c8675d46e60c39704d9098811a7.tar.gz |
Updated existing tests for June 2012 spec changes; removed LocaleList tests; fixed minor issues.
- Removed LocaleList tests; updated other tests so they don't depend on LocaleList.
- Updated tests so they no longer assume that the prototype object of a constructor is an instance of that constructor.
- Updated tests so that jshint is happy.
- Removed @path attributes from test files; updated comment in packager.py explaining why they're unnecessary.
- Removed "use strict" statements, which interfere with strict/non-strict testing.
- Removed testcase functions, which are unnecessary.
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.js | 33 |
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); + |