Add more fibonacci test cases.

This commit is contained in:
Oleksii Trekhleb 2018-09-14 17:56:38 +03:00
parent 46bc844fc6
commit dea368cb16
2 changed files with 10 additions and 0 deletions

View File

@ -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]);
});
});

View File

@ -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);
});
});