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 =
(* 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 ----"