Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Unified Diff: test/mjsunit/math-abs.js

Issue 6869007: Cleanup of mjsunit.js code and make assertEquals more strict. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/debug-scopes.js ('k') | test/mjsunit/math-min-max.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/math-abs.js
diff --git a/test/mjsunit/math-abs.js b/test/mjsunit/math-abs.js
index bec1a01c44214d8ef07f409a05e580bbd341df6c..33df6f4c4a99deca0b29c570843f530abe4e47c1 100644
--- a/test/mjsunit/math-abs.js
+++ b/test/mjsunit/math-abs.js
@@ -35,13 +35,13 @@ function zero() {
function test() {
assertEquals(0, Math.abs(0));
assertEquals(0, Math.abs(zero()));
- assertEquals(1/0, 1/Math.abs(-0)); // 0 == -0, so we use reciprocals.
+ assertEquals(0, Math.abs(-0));
assertEquals(Infinity, Math.abs(Infinity));
assertEquals(Infinity, Math.abs(-Infinity));
- assertNaN(Math.abs(NaN));
- assertNaN(Math.abs(-NaN));
- assertEquals('Infinity', Math.abs(Number('+Infinity').toString()));
- assertEquals('Infinity', Math.abs(Number('-Infinity').toString()));
+ assertEquals(NaN, Math.abs(NaN));
+ assertEquals(NaN, Math.abs(-NaN));
+ assertEquals('Infinity', Math.abs(Number('+Infinity')).toString());
+ assertEquals('Infinity', Math.abs(Number('-Infinity')).toString());
assertEquals('NaN', Math.abs(NaN).toString());
assertEquals('NaN', Math.abs(-NaN).toString());
@@ -85,8 +85,8 @@ function test() {
assertEquals(two_31 - 1, Math.abs(two_31 - 1));
assertEquals(two_31 - 1, Math.abs(-two_31 + 1));
- assertNaN(Math.abs("not a number"));
- assertNaN(Math.abs([1, 2, 3]));
+ assertEquals(NaN, Math.abs("not a number"));
+ assertEquals(NaN, Math.abs([1, 2, 3]));
assertEquals(42, Math.abs({valueOf: function() { return 42; } }));
assertEquals(42, Math.abs({valueOf: function() { return -42; } }));
}
« no previous file with comments | « test/mjsunit/debug-scopes.js ('k') | test/mjsunit/math-min-max.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698