aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorhannesw <none@none>2014-04-14 17:45:05 +0200
committerhannesw <none@none>2014-04-14 17:45:05 +0200
commit21a127ef32c5634863b2bd971f75f2540ebf65a2 (patch)
treefd4b0c53af95db96b444026181a968d8abcfd15e /test
parent19ba623793f5539d230677da57e7eaaf8941f486 (diff)
downloadnashorn-21a127ef32c5634863b2bd971f75f2540ebf65a2.tar.gz
8030200: Wrong result for Number.prototype.toString() for certain radix/inputs
Reviewed-by: sundar, jlaskey, lagergren
Diffstat (limited to 'test')
-rw-r--r--test/script/basic/JDK-8030200.js36
-rw-r--r--test/script/basic/JDK-8030200.js.EXPECTED3
-rw-r--r--test/script/basic/NASHORN-173.js.EXPECTED2
3 files changed, 40 insertions, 1 deletions
diff --git a/test/script/basic/JDK-8030200.js b/test/script/basic/JDK-8030200.js
new file mode 100644
index 00000000..e49eec7d
--- /dev/null
+++ b/test/script/basic/JDK-8030200.js
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8030200: Wrong result for Number.prototype.toString() for certain radix/inputs
+ *
+ * @test
+ * @run
+ */
+
+var n = 0x8000000000000800;
+print(n);
+var s = n.toString(5);
+var m = parseInt(s, 5);
+print(m === n);
+print(n);
diff --git a/test/script/basic/JDK-8030200.js.EXPECTED b/test/script/basic/JDK-8030200.js.EXPECTED
new file mode 100644
index 00000000..38b73bc2
--- /dev/null
+++ b/test/script/basic/JDK-8030200.js.EXPECTED
@@ -0,0 +1,3 @@
+9223372036854778000
+true
+9223372036854778000
diff --git a/test/script/basic/NASHORN-173.js.EXPECTED b/test/script/basic/NASHORN-173.js.EXPECTED
index a0781a88..5375ecb1 100644
--- a/test/script/basic/NASHORN-173.js.EXPECTED
+++ b/test/script/basic/NASHORN-173.js.EXPECTED
@@ -132,7 +132,7 @@ RangeError
2.3423446609034533e+21
2.3423446609034533e+21
11111101111101010001111111010101101000101011011001001000000000000000000
-2224143002343343220233144213324
+2224143002343343220233044213324
375752177255053311000000
73b92b9962990aa44400
7efa8fead15b240000