X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=ocaml%2Ftest.ml;h=629bf894ac082d9dfe564b0a31c349c3e7e6b812;hb=0dd15aa7265036c77e788c2c215316ff02f91945;hp=32d60aa62c054c28579858b1666e9f5962ab3b4c;hpb=d996cf6c47fdea2409dfb2e94430b0d080b8e8ae;p=fireball-separation.git diff --git a/ocaml/test.ml b/ocaml/test.ml index 32d60aa..629bf89 100644 --- a/ocaml/test.ml +++ b/ocaml/test.ml @@ -68,15 +68,18 @@ let rec repeat f n = if n > 0 then repeat f (n-1) ;; -let solve div convs nums = +let solve div convs nums label = let p = String.concat "\n" ( - "$! randomly generated test" :: + ("$! randomly generated test " ^ label) :: ("D " ^ div) :: List.map ((^) "C ") convs @ List.map (fun s -> "N " ^ s ^ " Z") nums ) in prerr_endline p; - (Lambda4.solve ++ Lambda4.problem_of ++ Parser.problem_of_string) p + match (Lambda4.solve ++ Lambda4.problem_of ++ Parser.problem_of_string) p with + | `Uncomplete, `Unseparable _ -> + failwith ("Test4.solve: unseparable, and cannot tell if that's right or not.") + | _ -> () ;; let main = @@ -86,20 +89,20 @@ let main = (* if flag --with-pac active, then more general tests *) let with_pac = List.mem "--with-pac" (Array.to_list Sys.argv) in - let f = if with_pac + let label, f = if with_pac then ( let complex = 10 in let vars = ["x"; "y"; "z"; "v" ; "w"; "a"; "b"; "c"] in - fun () -> gen_pac complex vars + "with pacmans & bombs", fun () -> gen_pac complex vars ) else ( let complex = 200 in let vars = ["x"; "y"; "z"; "v" ; "w"; "a"; "b"; "c"] in - fun () -> gen complex vars + "", fun () -> gen complex vars ) in repeat (fun _ -> let div, (conv, nums) = f () in - solve div conv nums + solve div conv nums label ) num; prerr_endline "\n---- ALL TESTS COMPLETED ----"