Permalink
Browse files

Epsilon check fix

Accidently passed the wrong argument to fail(). Also forgot that eps
passed to test should be of the type 1e-5, not 1e5.
  • Loading branch information...
1 parent 3c0dc3b commit 1e6eb0f3eb4dc7ed3e9452e3f55961289ed8b2f1 @trevnorris trevnorris committed Jun 22, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/assert/macros.js
  2. +1 −1 test/assert-test.js
View
@@ -18,7 +18,7 @@ for (var key in messages) {
assert.epsilon = function (eps, actual, expected, message) {
if (Math.abs(actual - expected) > eps) {
- assert.fail(actual, fail, message || "expected {expected} +-{eps}, but was {actual}");
+ assert.fail(actual, expected, message || "expected {expected} +-"+ eps +", but was {actual}");
}
};
View
@@ -8,7 +8,7 @@ vows.describe('vows/assert').addBatch({
assert.equal(1, true);
},
"`epsilon`": function() {
- assert.epsilon(1e5, 0.1+0.2, 0.3);
+ assert.epsilon(1e-5, 0.1+0.2, 0.3);
},
"`match`": function () {
assert.match("hello world", /^[a-z]+ [a-z]+$/);

0 comments on commit 1e6eb0f

Please sign in to comment.