mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-25 22:46:20 +08:00
Add more fibonacci test cases.
This commit is contained in:
parent
46bc844fc6
commit
dea368cb16
@ -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]);
|
||||
});
|
||||
});
|
||||
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user