diff options
Diffstat (limited to 'test/suite/intl402/ch10')
-rw-r--r-- | test/suite/intl402/ch10/10.2/10.2.1.js | 25 | ||||
-rw-r--r-- | test/suite/intl402/ch10/10.2/10.2.2.js | 27 | ||||
-rw-r--r-- | test/suite/intl402/ch10/10.2/10.2.3.js | 18 | ||||
-rw-r--r-- | test/suite/intl402/ch10/10.2/10.2.js | 16 | ||||
-rw-r--r-- | test/suite/intl402/ch10/10.3/10.3.1.js | 13 | ||||
-rw-r--r-- | test/suite/intl402/ch10/10.3/10.3.js | 15 |
6 files changed, 114 insertions, 0 deletions
diff --git a/test/suite/intl402/ch10/10.2/10.2.1.js b/test/suite/intl402/ch10/10.2/10.2.1.js new file mode 100644 index 000000000..6583bed08 --- /dev/null +++ b/test/suite/intl402/ch10/10.2/10.2.1.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. + +/** + * @description Tests that the Intl.Collator prototype object exists and + * is not writable, enumerable, or configurable. + */ + +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.'); +} + diff --git a/test/suite/intl402/ch10/10.2/10.2.2.js b/test/suite/intl402/ch10/10.2/10.2.2.js new file mode 100644 index 000000000..5cf953ce8 --- /dev/null +++ b/test/suite/intl402/ch10/10.2/10.2.2.js @@ -0,0 +1,27 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator has a supportedLocalesOf + * property, and it works as planned. + */ + +var defaultLocale = new Intl.Collator().resolvedOptions().locale; +var notSupported = 'zxx'; // "no linguistic content" +var requestedLocales = [defaultLocale, 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] !== defaultLocale) { + $ERROR('The default locale is not returned in the supported list.'); +} + diff --git a/test/suite/intl402/ch10/10.2/10.2.3.js b/test/suite/intl402/ch10/10.2/10.2.3.js new file mode 100644 index 000000000..c281491a0 --- /dev/null +++ b/test/suite/intl402/ch10/10.2/10.2.3.js @@ -0,0 +1,18 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests the internal properties of Intl.Collator. + */ + +var defaultLocale = new Intl.Collator([]).resolvedOptions().locale; +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 [[relevantExtensionKeys]] + +// FIXME: Find a way to check specified properties of [[localeData]] + diff --git a/test/suite/intl402/ch10/10.2/10.2.js b/test/suite/intl402/ch10/10.2/10.2.js new file mode 100644 index 000000000..2a9c073e9 --- /dev/null +++ b/test/suite/intl402/ch10/10.2/10.2.js @@ -0,0 +1,16 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the Intl.Collator constructor has a length + * property that equals 2. + */ + +if (!Intl.Collator.hasOwnProperty('length')) { + $ERROR('Intl.Collator has no length property'); +} + +if (Intl.Collator.length != 2) { + $ERROR('Intl.Collator.length is not 2.'); +} + diff --git a/test/suite/intl402/ch10/10.3/10.3.1.js b/test/suite/intl402/ch10/10.3/10.3.1.js new file mode 100644 index 000000000..699949e18 --- /dev/null +++ b/test/suite/intl402/ch10/10.3/10.3.1.js @@ -0,0 +1,13 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator.prototype.constructor is the + * Intl.Collator. + */ + +if (Intl.Collator.prototype.constructor !== Intl.Collator) { + $ERROR("Intl.Collator.prototype.constructor is not the same as " + + "Intl.Collator"); +} + diff --git a/test/suite/intl402/ch10/10.3/10.3.js b/test/suite/intl402/ch10/10.3/10.3.js new file mode 100644 index 000000000..aa2e52845 --- /dev/null +++ b/test/suite/intl402/ch10/10.3/10.3.js @@ -0,0 +1,15 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator.prototype is an object that + * has been initialized as an Intl.Collator. + */ + +// test by calling a function that would fail if "this" were not an object +// initialized as an Intl.Collator +if (Intl.Collator.prototype.compare("aаあ아", "aаあ아") !== 0) { + $ERROR("Intl.Collator.prototype is not an object that has been " + + "initialized as an Intl.Collator."); +} + |