Index: test/mjsunit/str-to-num.js |
=================================================================== |
--- test/mjsunit/str-to-num.js (revision 4248) |
+++ test/mjsunit/str-to-num.js (working copy) |
@@ -29,23 +29,8 @@ |
return Number(val); |
} |
-function repeat(s, num) { |
- var result = ''; |
- while (num > 0) { |
- if ((num & 1) != 0) result += s; |
- s += s; |
- num >>= 1; |
- } |
- |
- return result; |
-} |
- |
-assertEquals('0000000000', repeat('0', 10)); |
- |
// assertEquals(, toNumber()); |
-assertEquals(1, 1.); |
-assertEquals(1, toNumber("1.")); |
assertEquals(123, toNumber(" 123")); |
assertEquals(123, toNumber("\n123")); |
@@ -76,7 +61,6 @@ |
assertEquals(0, toNumber("0")); |
assertEquals(0, toNumber("+0")); |
assertEquals(-0, toNumber("-0")); |
-assertEquals(-Infinity, 1 / toNumber("-0")); |
assertEquals(1, toNumber("1")); |
assertEquals(1, toNumber("+1")); |
@@ -146,16 +130,11 @@ |
assertEquals(15, toNumber("0XF")); |
assertEquals(0, toNumber("0x000")); |
-assertEquals(-Infinity, 1 / toNumber("-0x000")); |
-assertEquals(0, toNumber("0x000" + repeat('0', 1000))); |
assertEquals(9, toNumber("0x009")); |
assertEquals(10, toNumber("0x00a")); |
assertEquals(10, toNumber("0x00A")); |
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(0, toNumber("00")); |
assertEquals(1, toNumber("01")); |
@@ -177,6 +156,3 @@ |
assertTrue(isNaN(toNumber("100.0 junk")), "100.0 junk"); |
assertTrue(isNaN(toNumber(".1e4 junk")), ".1e4 junk"); |
assertTrue(isNaN(toNumber("Infinity junk")), "Infinity junk"); |
-assertTrue(isNaN(toNumber("1e")), "1e"); |
-assertTrue(isNaN(toNumber("1e ")), "1e_"); |
-assertTrue(isNaN(toNumber("1" + repeat('0', 1000) + 'junk')), "1e1000 junk"); |