We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61d3486 commit 583deecCopy full SHA for 583deec
data_structures/tests/heap.test.js
@@ -17,7 +17,11 @@ const isSorted = (arr) => {
17
18
describe('heapsort', () => {
19
test('heapsort correctly sorts an array of integers', () => {
20
- const input = generateRandomInput(20, 100);
21
- expect(isSorted(heapsort(input))).toBe(true);
+ const len = Math.round(Math.random() * 100);
+ const input = generateRandomInput(len, 1000);
22
+ const output = heapsort(input);
23
+
24
+ expect(output.length).toEqual(len);
25
+ expect(isSorted(output)).toBe(true);
26
});
27
0 commit comments