Skip to content

Commit

Permalink
Add more fibonacci test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
trekhleb committed Sep 14, 2018
1 parent 46bc844 commit dea368c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/algorithms/math/fibonacci/__test__/fibonacci.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ describe('fibonacci', () => {
expect(fibonacci(6)).toEqual([1, 1, 2, 3, 5, 8]);
expect(fibonacci(7)).toEqual([1, 1, 2, 3, 5, 8, 13]);
expect(fibonacci(8)).toEqual([1, 1, 2, 3, 5, 8, 13, 21]);
expect(fibonacci(9)).toEqual([1, 1, 2, 3, 5, 8, 13, 21, 34]);
expect(fibonacci(10)).toEqual([1, 1, 2, 3, 5, 8, 13, 21, 34, 55]);
});
});
8 changes: 8 additions & 0 deletions src/algorithms/math/fibonacci/__test__/fibonacciNth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,13 @@ describe('fibonacciNth', () => {
expect(fibonacciNth(7)).toBe(13);
expect(fibonacciNth(8)).toBe(21);
expect(fibonacciNth(20)).toBe(6765);
expect(fibonacciNth(30)).toBe(832040);
expect(fibonacciNth(50)).toBe(12586269025);
expect(fibonacciNth(70)).toBe(190392490709135);
expect(fibonacciNth(71)).toBe(308061521170129);
expect(fibonacciNth(72)).toBe(498454011879264);
expect(fibonacciNth(73)).toBe(806515533049393);
expect(fibonacciNth(74)).toBe(1304969544928657);
expect(fibonacciNth(75)).toBe(2111485077978050);
});
});

0 comments on commit dea368c

Please sign in to comment.