Commit 88631e30 authored by Julien Lopez's avatar Julien Lopez
Browse files

[TESTS][TYPED] Add some tests

parent 71f4a2f7
......@@ -41,7 +41,19 @@ let tests = "CDuce runtime tests" >:::
(run_test "fun ([Int*] -> [Int*]) | [_ (rest::(Int*))] -> rest | [] -> []");
);
"union" >:: ( fun test_ctxt ->
assert_equal ~msg:"Test CDuce.runtime.union.match failed"
~printer:(fun x -> x) ""
(run_test "fun (Int | String -> Int | String) | x ->
match x with
| _ & Int -> 2
| _ & String -> \"Piece of cake\"");
);
"poly" >:: ( fun test_ctxt ->
assert_equal ~msg:"Test CDuce.typed.poly.is_equal failed"
~printer:(fun x -> x) ""
(run_test "fun (`A -> `A -> Bool) | x -> (fun (`A -> Bool) | y -> (x = y))");
assert_equal ~msg:"Test CDuce.typed.poly.string_of failed"
~printer:(fun x -> x) ""
(run_test "(fun (`A -> String) | x -> string_of x)5");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment