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.js26
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.2.js28
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.3.js19
-rw-r--r--test/suite/intl402/ch11/11.2/11.2.js17
4 files changed, 90 insertions, 0 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
new file mode 100644
index 000000000..0ff91067a
--- /dev/null
+++ b/test/suite/intl402/ch11/11.2/11.2.1.js
@@ -0,0 +1,26 @@
+// 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.NumberFormat prototype object exists and
+ * is not writable, enumerable, or configurable.
+ * @author: Roozbeh Pournader
+ */
+
+var desc;
+
+if (!Intl.NumberFormat.hasOwnProperty('prototype')) {
+ $ERROR('Intl.NumberFormat has no prototype property');
+}
+
+desc = Object.getOwnPropertyDescriptor(Intl.NumberFormat, 'prototype');
+if (desc.writable === true) {
+ $ERROR('Intl.NumberFormat.prototype is writable.');
+}
+if (desc.enumerable === true) {
+ $ERROR('Intl.NumberFormat.prototype is enumerable.');
+}
+if (desc.configurable === true) {
+ $ERROR('Intl.NumberFormat.prototype is configurable.');
+}
+
diff --git a/test/suite/intl402/ch11/11.2/11.2.2.js b/test/suite/intl402/ch11/11.2/11.2.2.js
new file mode 100644
index 000000000..c6c9f9a46
--- /dev/null
+++ b/test/suite/intl402/ch11/11.2/11.2.2.js
@@ -0,0 +1,28 @@
+// Copyright 2012 Google Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @description Tests that Intl.NumberFormat has a supportedLocalesOf
+ * property, and it works as planned.
+ * @author: Roozbeh Pournader
+ */
+
+var defaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
+var notSupported = 'zxx'; // "no linguistic content"
+var requestedLocales = [defaultLocale, notSupported];
+
+var supportedLocales;
+
+if (!Intl.NumberFormat.hasOwnProperty('supportedLocalesOf')) {
+ $ERROR("Intl.NumberFormat doesn't have a supportedLocalesOf property.");
+}
+
+supportedLocales = Intl.NumberFormat.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/ch11/11.2/11.2.3.js b/test/suite/intl402/ch11/11.2/11.2.3.js
new file mode 100644
index 000000000..b0f30e495
--- /dev/null
+++ b/test/suite/intl402/ch11/11.2/11.2.3.js
@@ -0,0 +1,19 @@
+// 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.NumberFormat.
+ * @author: Roozbeh Pournader
+ */
+
+var defaultLocale = new Intl.NumberFormat([]).resolvedOptions().locale;
+var supportedLocales = Intl.NumberFormat.supportedLocalesOf([defaultLocale]);
+
+if (supportedLocales.length < 1 || supportedLocales[0] !== defaultLocale) {
+ $ERROR('The default locale is not supported by Intl.NumberFormat');
+}
+
+// FIXME: Find a way to check that [[relevantExtensionKeys]] === ['nu']
+
+// FIXME: Find a way to check specified properties of [[localeData]]
+
diff --git a/test/suite/intl402/ch11/11.2/11.2.js b/test/suite/intl402/ch11/11.2/11.2.js
new file mode 100644
index 000000000..8094d3bd1
--- /dev/null
+++ b/test/suite/intl402/ch11/11.2/11.2.js
@@ -0,0 +1,17 @@
+// 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.NumberFormat constructor has a length
+ * property that equals 2.
+ * @author: Roozbeh Pournader
+ */
+
+if (!Intl.NumberFormat.hasOwnProperty('length')) {
+ $ERROR('Intl.NumberFormat has no length property');
+}
+
+if (Intl.NumberFormat.length != 2) {
+ $ERROR('Intl.NumberFormat.length is not 2.');
+}
+