Index: test/mjsunit/str-to-num.js |
=================================================================== |
--- test/mjsunit/str-to-num.js (revision 4304) |
+++ test/mjsunit/str-to-num.js (working copy) |
@@ -44,7 +44,6 @@ |
// assertEquals(, toNumber()); |
- |
assertEquals(123, toNumber(" 123")); |
assertEquals(123, toNumber("\n123")); |
assertEquals(123, toNumber("\r123")); |
@@ -151,10 +150,32 @@ |
assertEquals(10, toNumber("0x00A")); |
assertEquals(15, toNumber("0x00f")); |
assertEquals(15, toNumber("0x00F")); |
+assertEquals(15, toNumber("0x00F ")); |
assertEquals(Infinity, toNumber("0x" + repeat('0', 1000) + '1' |
+ repeat('0', 1000))); |
assertEquals(-Infinity, toNumber("-0x1" + repeat('0', 1000))); |
+assertEquals(0x1000000 * 0x10000000, toNumber("0x10000000000000")); |
+assertEquals(0x1000000 * 0x10000000 + 1, toNumber("0x10000000000001")); |
+assertEquals(0x10 * 0x1000000 * 0x10000000, toNumber("0x100000000000000")); |
+assertEquals(0x10 * 0x1000000 * 0x10000000, toNumber("0x100000000000001")); |
+assertEquals(0x10 * 0x1000000 * 0x10000000, toNumber("0x100000000000007")); |
+assertEquals(0x10 * 0x1000000 * 0x10000000, toNumber("0x100000000000008")); |
+assertEquals(0x10 * (0x1000000 * 0x10000000 + 1), |
+ toNumber("0x100000000000009")); |
+assertEquals(0x10 * (0x1000000 * 0x10000000 + 1), |
+ toNumber("0x10000000000000F")); |
+assertEquals(0x10 * (0x1000000 * 0x10000000 + 1), |
+ toNumber("0x100000000000010")); |
+assertEquals(0x100000000000 * 0x1000000 * 0x10000000, |
+ toNumber("0x1000000000000000000000000")); |
+assertEquals(0x100000000000 * 0x1000000 * 0x10000000, |
+ toNumber("0x1000000000000080000000000")); |
+assertEquals(0x100000000000 * (0x1000000 * 0x10000000 + 1), |
+ toNumber("0x1000000000000080000000001")); |
+assertEquals(0x100000000000 * 0x1000000 * 0x10000000, |
+ toNumber(" 0x1000000000000000000000000 ")); |
+ |
assertEquals(0, toNumber("00")); |
assertEquals(1, toNumber("01")); |
assertEquals(2, toNumber("02")); |