diff --git a/test/interpreter/function-left.spec.ts b/test/interpreter/function-left.spec.ts index 7a52bc8ce1..4968fb5002 100644 --- a/test/interpreter/function-left.spec.ts +++ b/test/interpreter/function-left.spec.ts @@ -1,4 +1,4 @@ -import {ErrorType, HyperFormula} from '../../src' +import {CellType, CellValueType, ErrorType, HyperFormula} from '../../src' import {ErrorMessage} from '../../src/error-message' import {adr, detailedError} from '../testUtils' @@ -65,13 +65,17 @@ describe('Function LEFT', () => { it('should coerce other types to string', () => { const engine = HyperFormula.buildFromArray([ - ['=LEFT(1, 1)'], + ['=LEFT(10, 1)'], ['=LEFT(5+5, 1)'], ['=LEFT(TRUE(), 1)'], + ['=LEFT("010", 1)'], + ['=LEFT(B5, 1)', "'010"], ]) expect(engine.getCellValue(adr('A1'))).toEqual('1') expect(engine.getCellValue(adr('A2'))).toEqual('1') expect(engine.getCellValue(adr('A3'))).toEqual('T') + expect(engine.getCellValue(adr('A4'))).toEqual('0') + expect(engine.getCellValue(adr('A5'))).toEqual('0') }) })