Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "disect", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Bisection helper for javascript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
var bisect = require('../'); | ||
exports['test find 1 in 0..10'] = function (test) { | ||
var called = false; | ||
var expected = 1; | ||
test.expect(2 + 4); // 4 iterations expected | ||
var actual = bisect(0, 10, function (index) { | ||
test.ok(true, "We should get called"); | ||
called = true; | ||
return index >= expected; | ||
}); | ||
test.equal(expected, actual, "We should find 1 at index 1"); | ||
test.ok(called, "We should have called our predicate"); | ||
test.done(); | ||
} | ||
exports['test find 4 in 0..10'] = function (test) { | ||
@@ -4,0 +18,0 @@ var called = false; |
Sorry, the diff of this file is not supported yet
7567
139
74