summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Number/prototype/toString/S15.7.4.2_A2_T03.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Number/prototype/toString/S15.7.4.2_A2_T03.js')
-rw-r--r--js/src/tests/test262/built-ins/Number/prototype/toString/S15.7.4.2_A2_T03.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Number/prototype/toString/S15.7.4.2_A2_T03.js b/js/src/tests/test262/built-ins/Number/prototype/toString/S15.7.4.2_A2_T03.js
new file mode 100644
index 0000000000..d928cfe256
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Number/prototype/toString/S15.7.4.2_A2_T03.js
@@ -0,0 +1,35 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ toString: If radix is an integer from 2 to 36, but not 10,
+ the result is a string, the choice of which is implementation-dependent
+es5id: 15.7.4.2_A2_T03
+description: radix is 4
+---*/
+assert.sameValue(Number.prototype.toString(4), "0", 'Number.prototype.toString(4) must return "0"');
+assert.sameValue((new Number()).toString(4), "0", '(new Number()).toString(4) must return "0"');
+assert.sameValue((new Number(0)).toString(4), "0", '(new Number(0)).toString(4) must return "0"');
+assert.sameValue((new Number(-1)).toString(4), "-1", '(new Number(-1)).toString(4) must return "-1"');
+assert.sameValue((new Number(1)).toString(4), "1", '(new Number(1)).toString(4) must return "1"');
+
+assert.sameValue(
+ (new Number(Number.NaN)).toString(4),
+ "NaN",
+ '(new Number(Number.NaN)).toString(4) must return "NaN"'
+);
+
+assert.sameValue(
+ (new Number(Number.POSITIVE_INFINITY)).toString(4),
+ "Infinity",
+ '(new Number(Number.POSITIVE_INFINITY)).toString(4) must return "Infinity"'
+);
+
+assert.sameValue(
+ (new Number(Number.NEGATIVE_INFINITY)).toString(4),
+ "-Infinity",
+ '(new Number(Number.NEGATIVE_INFINITY)).toString(4) must return "-Infinity"'
+);
+
+reportCompare(0, 0);