aboutsummaryrefslogtreecommitdiff
path: root/tests/expression_query.ml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/expression_query.ml')
-rw-r--r--tests/expression_query.ml18
1 files changed, 18 insertions, 0 deletions
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