From ba15c54e1fc787cfe95c60df78ff7feda30e90ec Mon Sep 17 00:00:00 2001 From: Kuba Sekowski Date: Sat, 2 Dec 2023 11:59:38 +0100 Subject: [PATCH] Add a unit test to cover the uncovered line in ArraySize.ts --- test/interpreter/function-match.spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/interpreter/function-match.spec.ts b/test/interpreter/function-match.spec.ts index e3d0b778e..a2ab4e633 100644 --- a/test/interpreter/function-match.spec.ts +++ b/test/interpreter/function-match.spec.ts @@ -14,6 +14,16 @@ describe('Function MATCH', () => { expect(engine.getCellValue(adr('A2'))).toEqualError(detailedError(ErrorType.NA, ErrorMessage.WrongArgNumber)) }) + it('validates number of arguments when array arithmetics is on', () => { + const engine = HyperFormula.buildFromArray([ + ['=MATCH(1)'], + ['=MATCH(1, B1:B3, 0, 42)'], + ], { useArrayArithmetic: true }) + + expect(engine.getCellValue(adr('A1'))).toEqualError(detailedError(ErrorType.NA, ErrorMessage.WrongArgNumber)) + expect(engine.getCellValue(adr('A2'))).toEqualError(detailedError(ErrorType.NA, ErrorMessage.WrongArgNumber)) + }) + it('validates that 1st argument is number, string or boolean', () => { const engine = HyperFormula.buildFromArray([ ['=MATCH(C2:C3, B1:B1)'],