From 5492acd75cc0ce6a741970d4fc39fc7ad7010753 Mon Sep 17 00:00:00 2001 From: poma Date: Sat, 6 Mar 2021 15:21:44 +0300 Subject: [PATCH] lint --- test/binarySearch.test.js | 49 +++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/test/binarySearch.test.js b/test/binarySearch.test.js index e765b94..31247e7 100644 --- a/test/binarySearch.test.js +++ b/test/binarySearch.test.js @@ -28,40 +28,70 @@ describe('findArrayLength', () => { }) it('should work for even array', async () => { - const depositsLength = await tornadoTrees.findArrayLengthMock(publicArray.address, 'deposits(uint256)', 4, 2) + const depositsLength = await tornadoTrees.findArrayLengthMock( + publicArray.address, + 'deposits(uint256)', + 4, + 2, + ) expect(depositsLength).to.be.equal(depositsEven.length) }) it('should work for empty array', async () => { publicArray = await PublicArray.deploy() // will throw out of gas if you pass non zero params - const depositsLength = await tornadoTrees.findArrayLengthMock(publicArray.address, 'deposits(uint256)', 0, 0) + const depositsLength = await tornadoTrees.findArrayLengthMock( + publicArray.address, + 'deposits(uint256)', + 0, + 0, + ) expect(depositsLength).to.be.equal(0) }) it('should work for odd array', async () => { publicArray = await PublicArray.deploy() await publicArray.setDeposits(depositsOdd) - const depositsLength = await tornadoTrees.findArrayLengthMock(publicArray.address, 'deposits(uint256)', 4, 2) + const depositsLength = await tornadoTrees.findArrayLengthMock( + publicArray.address, + 'deposits(uint256)', + 4, + 2, + ) expect(depositsLength).to.be.equal(depositsOdd.length) }) it('should work for even array and odd step', async () => { - const depositsLength = await tornadoTrees.findArrayLengthMock(publicArray.address, 'deposits(uint256)', 4, 3) + const depositsLength = await tornadoTrees.findArrayLengthMock( + publicArray.address, + 'deposits(uint256)', + 4, + 3, + ) expect(depositsLength).to.be.equal(depositsEven.length) }) it('should work for odd array and odd step', async () => { publicArray = await PublicArray.deploy() await publicArray.setDeposits(depositsOdd) - const depositsLength = await tornadoTrees.findArrayLengthMock(publicArray.address, 'deposits(uint256)', 4, 3) + const depositsLength = await tornadoTrees.findArrayLengthMock( + publicArray.address, + 'deposits(uint256)', + 4, + 3, + ) expect(depositsLength).to.be.equal(depositsOdd.length) }) it('should work for odd array and step 1', async () => { publicArray = await PublicArray.deploy() await publicArray.setDeposits(depositsOdd) - const depositsLength = await tornadoTrees.findArrayLengthMock(publicArray.address, 'deposits(uint256)', 4, 1) + const depositsLength = await tornadoTrees.findArrayLengthMock( + publicArray.address, + 'deposits(uint256)', + 4, + 1, + ) expect(depositsLength).to.be.equal(depositsOdd.length) }) @@ -82,7 +112,12 @@ describe('findArrayLength', () => { const deposits = Array.from(Array(30).keys()) publicArray = await PublicArray.deploy() await publicArray.setDeposits(deposits) - const depositsLength = await tornadoTrees.findArrayLengthMock(publicArray.address, 'deposits(uint256)', 1, 50) + const depositsLength = await tornadoTrees.findArrayLengthMock( + publicArray.address, + 'deposits(uint256)', + 1, + 50, + ) expect(depositsLength).to.be.equal(deposits.length) })