Skip to content

Commit

Permalink
Cover bisect iteration error line
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Jul 13, 2016
1 parent 65478fd commit 08f6bfd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/bisect.test.js
Expand Up @@ -8,6 +8,9 @@ test('bisect', function(t) {
t.test('can find root of sin and cos', function(t) {
t.equal(Number(bisect(Math.sin, 1, 4, 100, 0.003).toFixed(4)), 3.1416);
t.equal(Number(bisect(Math.cos, 0, 4, 100, 0.003).toFixed(4)), 1.5723);
t.throws(function() {
t.equal(Number(bisect(Math.cos, 0, 4, 1, 0.003).toFixed(4)), 1.5723);
}, 'Throws if it exceeds the number of iterations allowed');
t.throws(function() {
bisect(0);
}, 'Throws with syntax error f must be a function');
Expand Down

0 comments on commit 08f6bfd

Please sign in to comment.