Commit 8ad17987 authored by Julien Lopez's avatar Julien Lopez

Fixes on ocaml interface (code and tests)

parent e0fb3c2c
This diff is collapsed.
......@@ -52,11 +52,11 @@ let tests = "Misc" >:::
);
"pp" >:: ( fun test_ctxt ->
assert_equal ~msg:"Test Misc.pp.1 failed" "(`C,3)" (Misc.pp (Misc.C(3)));
assert_equal ~msg:"Test Misc.pp.1 failed" "(`C,3,Mono)" (Misc.pp (Misc.C(3)));
assert_equal ~msg:"Test Misc.pp.2 failed"
"(`A,(`C,3))" (Misc.pp (Misc.A(Misc.C(3))));
"(`A,(`C,3,Mono),Mono)" (Misc.pp (Misc.A(Misc.C(3))));
assert_equal ~msg:"Test Misc.pp.3 failed"
"(`B,((`C,3),(`A,(`C,2))))" (Misc.pp (Misc.B(Misc.C(3),Misc.A(Misc.C(2)))));
"(`B,((`C,3,Mono),(`A,(`C,2,Mono),Mono),Mono),Mono)" (Misc.pp (Misc.B(Misc.C(3),Misc.A(Misc.C(2)))));
);
"find" >:: ( fun test_ctxt ->
......@@ -120,14 +120,14 @@ let tests = "Misc" >:::
let stack = Misc.Novalue() in
let stack = Misc.push stack p1 in
assert_equal ~msg:"Test Misc.stack.push1 failed"
"{ a=1.200000 b=0.300000 c=0.500000 }" (Misc.print_stack stack);
"{ a=1.200000 b=0.300000 c=0.500000 },Mono" (Misc.print_stack stack);
let stack = Misc.push stack p2 in
assert_equal ~msg:"Test Misc.stack.push2 failed"
"{ a=-0.200000 b=0.400000 c=0.700000 }{ a=1.200000 b=0.300000 c=0.500000 }"
"{ a=-0.200000 b=0.400000 c=0.700000 },Mono{ a=1.200000 b=0.300000 c=0.500000 },Mono"
(Misc.print_stack stack);
let stack = Misc.pop stack in
assert_equal ~msg:"Test Misc.stack.pop1 failed"
"{ a=1.200000 b=0.300000 c=0.500000 }" (Misc.print_stack stack);
"{ a=1.200000 b=0.300000 c=0.500000 },Mono" (Misc.print_stack stack);
let stack = Misc.pop stack in
assert_equal ~msg:"Test Misc.stack.pop2 failed" ""
(Misc.print_stack stack);
......
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