fix: speed up tests

Either improved the algorithm or reduced the difficulty for the slowest
tests. All these pass with testProtectTimeout = 500, so should be safe
on most machines with the current timeout of 2500.
This commit is contained in:
Oliver Eyton-Williams
2019-12-12 13:02:58 +01:00
committed by mrugesh
parent f5feff386a
commit e4a229187e
4 changed files with 60 additions and 36 deletions

View File

@@ -31,8 +31,8 @@ tests:
testString: assert(typeof emirps === 'function');
- text: <code>emirps(20,true)</code> should return <code>[13,17,31,37,71,73,79,97,107,113,149,157,167,179,199,311,337,347,359,389]</code>
testString: assert.deepEqual(emirps(20, true), [13, 17, 31, 37, 71, 73, 79, 97, 107, 113, 149, 157, 167, 179, 199, 311, 337, 347, 359, 389]);
- text: <code>emirps(10000)</code> should return <code>948349</code>
testString: assert.deepEqual(emirps(10000), 948349);
- text: <code>emirps(1000)</code> should return <code>70529</code>
testString: assert.deepEqual(emirps(1000), 70529);
- text: <code>emirps([7700,8000],true)</code> should return <code>[7717,7757,7817,7841,7867,7879,7901,7927,7949,7951,7963]</code>
testString: assert.deepEqual(emirps([7700, 8000], true), [7717, 7757, 7817, 7841, 7867, 7879, 7901, 7927, 7949, 7951, 7963]);
- text: <code>emirps([7700,8000],true)</code> should return <code>11</code>