From 01d7f77f65c3a2b83978b1f00c87b54f00647816 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Wed, 25 Oct 2017 14:50:32 +0200 Subject: Update sheet traversal --- tests/odf/odf_ExpressionParser_test.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests/odf') diff --git a/tests/odf/odf_ExpressionParser_test.ml b/tests/odf/odf_ExpressionParser_test.ml index 2cdb3bb..becf9ab 100755 --- a/tests/odf/odf_ExpressionParser_test.ml +++ b/tests/odf/odf_ExpressionParser_test.ml @@ -13,6 +13,13 @@ let _msg ~(expected:ScTypes.expression) ~(result:ScTypes.expression) = (UTF8.raw_encode @@ UTF8.Buffer.contents b2) + +let build_num value = ScTypes.Num ( + ScTypes.Number, + DataType.Num.of_num @@ Num.num_of_int value +) + + let test_formula ctx = begin let test1 = "of:=CONCATENATE(SUM([.F16:.AJ16]);\"/\";8*NETWORKDAYS([.F6]; [.F6]+(ORG.OPENOFFICE.DAYSINMONTH([.F6])-1)))" in @@ -27,7 +34,7 @@ let test_formula ctx = begin Ref (Range (((6, 16), (false, false)), (((36, 16), (false, false)))))]); Value (Str (u"/")); Call(u"*", [ - Value (Num ((Num.num_of_int 8, Some (u"8")))); + Value (build_num 8); Call(u"NETWORKDAYS", [ Ref (Cell ((6, 6), (false, false))); Call(u"+", [ @@ -36,7 +43,7 @@ let test_formula ctx = begin Call( u"-", [ Call(u"ORG.OPENOFFICE.DAYSINMONTH", [ Ref (Cell ((6, 6), (false, false)))]); - Value (Num ((Num.num_of_int 1, Some (u"1")))); + Value (build_num 1); ]))])])])])) in assert_equal -- cgit v1.2.3