OSDN Git Service

merge src/ and test/ at driver/
[happyabc/happyabc.git] / xml / codeTest.ml
1 open Base
2 open OUnit
3 open EasyXml
4
5 let ok x y =
6   OUnit.assert_equal ~printer:Xml.to_string_fmt (normalize x) (normalize y)
7
8 let _ = 
9   ("code module test" >::: [
10      "add" >::
11        (fun _ ->
12           ok (elem "OpAdd" []) @@
13             Code.to_xml `Add);
14      "constructprop" >::
15        (fun _ ->
16           ok (attr "OpConstructProp" ["name","1";"argc","42"]) @@
17             Code.to_xml (`ConstructProp (1l,42l)));
18      "getlex" >::
19        (fun _ ->
20           ok (attr "OpGetLex" ["name","42"]) @@
21             Code.to_xml (`GetLex 42l))
22    ]) +> run_test_tt_main