OSDN Git Service

[ADD]cond test case
authormzp <mzpppp@gmail.com>
Mon, 10 Nov 2008 02:06:57 +0000 (11:06 +0900)
committermzp <mzpppp@gmail.com>
Mon, 10 Nov 2008 02:06:57 +0000 (11:06 +0900)
src/.ocamlinit
test/test_lisp.ml

index ec5d9b6..bea329d 100644 (file)
@@ -15,6 +15,7 @@
 
 #load "ast.cmo";;
 #load "closuretrans.cmo";;
+#load "closTrans.cmo";;
 
 
 #load "parsec.cmo";;
index 2245f72..1b7bd20 100644 (file)
@@ -74,6 +74,14 @@ let _ =
        (fun () ->
          ok (result (If (Int 1,Int 2,Int 3))) @@ 
            Lisp.compile_string "(if 1 2 3)");
+     "cond" >::
+       (fun () ->
+         ok (result (If (Int 1,
+                         Int 2,
+                         If (Int 3,
+                             Int 4,
+                             Int 5)))) @@
+           Lisp.compile_string "(cond ([1] 2) ((3) 4) (else 5))");
      "let" >::
        (fun () ->
          ok (result (Let (["x",Int 1;"y",Int 2],Block [Var "x";Var "y"]))) @@