mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-09-20 07:43:04 +08:00
Adds linearPrimeSieve tests
This commit is contained in:
parent
786cd38228
commit
65037f32dd
@ -0,0 +1,12 @@
|
||||
import linearPrimeSieve from '../linearPrimeSieve';
|
||||
|
||||
describe('linearPrimeSieve', () => {
|
||||
it('should find all primes less than or equal to n', () => {
|
||||
expect(linearPrimeSieve(5)).toEqual([2, 3, 5]);
|
||||
expect(linearPrimeSieve(10)).toEqual([2, 3, 5, 7]);
|
||||
expect(linearPrimeSieve(100)).toEqual([
|
||||
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41,
|
||||
43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97,
|
||||
]);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user