diff options
Diffstat (limited to 'tests/odf')
-rwxr-xr-x | tests/odf/odf_ExpressionParser_test.ml | 11 |
1 files changed, 9 insertions, 2 deletions
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
|