Commit 5022e868 authored by Julien Lopez's avatar Julien Lopez
Browse files

[TESTS][LAMBDA][MINOR] Fix a test; add Op to the lambda printer

parent 29dc26a3
......@@ -232,8 +232,8 @@ let tests_eval = "CDuce runtime tests (Typed -> Lambda -> Value)" >:::
assert_equal ~msg:"Test CDuce.runtime.misc.map_even_hard failed"
~printer:(fun x -> x)
"(Atom(true),(\"hey\",((3,(5,Atom(nil),Id),{ { `$A = Int } ,{ `$A = Bool
} }),(Atom(true),(Abstraction((`$C,`$C),Comp({ { `$A = Int } ,{ `$A =
Bool } },Sel(1,(`$C -> `$C),Id))),(Atom(false),Atom(nil),Id),Id),Id),Id),Id),Id)"
} }),(Atom(true),(Abstraction((`$C,`$C),{ { `$A = Int } ,{ `$A = Bool
} }),(Atom(false),Atom(nil),Id),Id),Id),Id),Id),Id)"
(run_test_eval "(fun map f : ('A->'B) x : ['A] : ['B] ->
match x : ['A] with
| (el : 'A) :: (rest : ['A]) -> ((f.el), ((map.f).rest))
......
......@@ -245,6 +245,7 @@ and pp_lambda ppf =
| Pair(e1, e2) -> Format.fprintf ppf "Pair(%a, %a)" pp_lambda e1 pp_lambda e2
| String(_) -> Format.fprintf ppf "String"
| Match(e, brs) -> Format.fprintf ppf "Match(%a, %a)" pp_lambda e pp_lbranches brs
| Op(str, le) -> Format.fprintf ppf "Op(%s, (" str; print_lst pp_lambda ppf le; Format.fprintf ppf "))"
| _ -> ()
and pp_lbranches ppf brs =
......
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