Skip to content

Commit

Permalink
Add a unit test to cover the uncovered line in ArraySize.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sequba committed Dec 2, 2023
1 parent c2caac8 commit ba15c54
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/interpreter/function-match.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)'],
Expand Down

0 comments on commit ba15c54

Please sign in to comment.