Index: test/mjsunit/harmony/math-trunc.js |
diff --git a/test/mjsunit/harmony/math-sign.js b/test/mjsunit/harmony/math-trunc.js |
similarity index 59% |
copy from test/mjsunit/harmony/math-sign.js |
copy to test/mjsunit/harmony/math-trunc.js |
index 8a89d62828bdbd43a972498f0b32d1a27939171e..ed91ed1380f54ff46cf7b125dae87863b54baee7 100644 |
--- a/test/mjsunit/harmony/math-sign.js |
+++ b/test/mjsunit/harmony/math-trunc.js |
@@ -27,22 +27,25 @@ |
// Flags: --harmony-maths |
-assertEquals("Infinity", String(1/Math.sign(0))); |
-assertEquals("-Infinity", String(1/Math.sign(-0))); |
-assertEquals(1, Math.sign(100)); |
-assertEquals(-1, Math.sign(-199)); |
-assertEquals(1, Math.sign(100.1)); |
-assertTrue(isNaN(Math.sign("abc"))); |
-assertTrue(isNaN(Math.sign({}))); |
-assertEquals(0, Math.sign([])); |
-assertEquals(1, Math.sign([1])); |
-assertEquals(-1, Math.sign([-100.1])); |
-assertTrue(isNaN(Math.sign([1, 1]))); |
-assertEquals(1, Math.sign({ toString: function() { return "100"; } })); |
-assertEquals(1, Math.sign({ toString: function() { return 100; } })); |
-assertEquals(-1, Math.sign({ valueOf: function() { return -1.1; } })); |
-assertEquals(-1, Math.sign({ valueOf: function() { return "-1.1"; } })); |
-assertEquals(-1, Math.sign(-Infinity)); |
-assertEquals(1, Math.sign(Infinity)); |
-assertEquals(-1, Math.sign("-Infinity")); |
-assertEquals(1, Math.sign("Infinity")); |
+assertEquals("Infinity", String(1/Math.trunc(0))); |
+assertEquals("-Infinity", String(1/Math.trunc(-0))); |
+assertEquals("Infinity", String(1/Math.trunc(Math.PI/4))); |
+assertEquals("-Infinity", String(1/Math.trunc(-Math.sqrt(2)/2))); |
+assertEquals(100, Math.trunc(100)); |
+assertEquals(-199, Math.trunc(-199)); |
+assertEquals(100, Math.trunc(100.1)); |
+assertTrue(isNaN(Math.trunc("abc"))); |
+assertTrue(isNaN(Math.trunc({}))); |
+assertEquals(0, Math.trunc([])); |
+assertEquals(1, Math.trunc([1])); |
+assertEquals(-100, Math.trunc([-100.1])); |
+assertTrue(isNaN(Math.trunc([1, 1]))); |
+assertEquals(-100, Math.trunc({ toString: function() { return "-100.3"; } })); |
+assertEquals(10, Math.trunc({ toString: function() { return 10.1; } })); |
+assertEquals(-1, Math.trunc({ valueOf: function() { return -1.1; } })); |
+assertEquals("-Infinity", |
+ String(1/Math.trunc({ valueOf: function() { return "-0.1"; } }))); |
+assertEquals("-Infinity", String(Math.trunc(-Infinity))); |
+assertEquals("Infinity", String(Math.trunc(Infinity))); |
+assertEquals("-Infinity", String(Math.trunc("-Infinity"))); |
+assertEquals("Infinity", String(Math.trunc("Infinity"))); |