Add a test for Math.max/min on negative zero.
authorMs2ger <ms2ger@gmail.com>
Wed, 04 Jul 2012 21:10:28 +0200
changeset 10 e0a9564ea062
parent 9 815cdf540a0d
child 11 9f25b2278c3a
Add a test for Math.max/min on negative zero.
builtins/Math.maxmin.js
--- a/builtins/Math.maxmin.js	Wed Jun 20 13:49:49 2012 +0200
+++ b/builtins/Math.maxmin.js	Wed Jul 04 21:10:28 2012 +0200
@@ -44,4 +44,14 @@
   test(function() {
     assert_equals(Math[aFun]("1"), 1);
   }, "Should return a number.");
+  test(function() {
+    var expected = {
+      "max": 0,
+      "min": -0
+    }
+    assert_equals(Math[aFun](0, -0), expected[aFun]);
+    assert_equals(Math[aFun](-0, 0), expected[aFun]);
+    assert_equals(Math[aFun](0, 0), 0);
+    assert_equals(Math[aFun](-0, -0), -0);
+  }, "Should handle negative zero correctly.");
 }