diff --git a/packages/math/test/floodwalk.js b/packages/math/test/floodwalk.js index 7589049..55ac3af 100644 --- a/packages/math/test/floodwalk.js +++ b/packages/math/test/floodwalk.js @@ -8,19 +8,19 @@ describe('Floodwalk', () => { it('can walk', () => { const data = [ 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 1, 0, + 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, ]; let correct = data.reduce((r, v, i) => r.concat(v ? [+i] : []), []); expect( - floodwalk(data, [1, 1], 8, 4) + floodwalk(new Set([1]), data, [1, 1, 8, 4]) .sort((l, r) => l < r ? -1 : 1) ).to.deep.equal(correct); data[12] = 0; - correct = [9, 10, 16, 17, 18, 19]; + correct = [9, 10, 11, 16, 17, 18, 19]; expect( - floodwalk(data, [1, 1], 8, 4) + floodwalk(new Set([1]), data, [1, 1, 8, 4]) .sort((l, r) => l < r ? -1 : 1) ).to.deep.equal(correct); });