From f5332b2c7bbf6128de5f2467560e808d8d8d41f3 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Thu, 26 Dec 2024 21:22:23 +0100 Subject: Added a cmp function --- tests/expression_query.ml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/expression_query.ml') diff --git a/tests/expression_query.ml b/tests/expression_query.ml index d260a76..e2abc43 100644 --- a/tests/expression_query.ml +++ b/tests/expression_query.ml @@ -180,6 +180,23 @@ let counter_order = assert_equal ~printer expected content +let cmp = + "cmp" >:: fun _ -> + let expr = + eval + @@ Expr.( + function' T.Cmp + [ + Expr.integer_zero; + Expr.integer_one; + Expr.integer_neg_one; + Expr.integer_zero; + Expr.integer_one; + ]) + in + let content = test_expr expr and expected = "IIF(0=1, 0, IIF(0>1, 1, -1))" in + assert_equal ~printer expected content + let test_suit = [ empty; @@ -203,6 +220,7 @@ let test_suit = max; counter_no_order; counter_order; + cmp; ] let tests = "expression_query" >::: test_suit -- cgit v1.2.3