PageRenderTime 14ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 6ms app.codeStats 1ms

/test_List.ml

http://github.com/alanfalloon/ocaml-quickcheck
OCaml | 17 lines | 12 code | 2 blank | 3 comment | 0 complexity | f999e3e61183a6a5deaf63961f1e117b MD5 | raw file
 1open QuickCheck
 2
 3let prop_revrev : 'a list -> bool =
 4  fun xs -> List.rev (List.rev xs) = xs
 5
 6(* for generating random int lists *)
 7module AL = Arbitrary_list(Arbitrary_int) ;;
 8(* for printing out int lists *)
 9module SL = PShow_list(PShow_int) ;;
10(* for being able to test (int list -> bool) *)
11module Testable_list_to_bool =
12  Testable_fun
13    (AL)
14    (SL)
15    (Testable_bool) ;;
16module C = Check(Testable_list_to_bool)
17let () = C.quickCheck prop_revrev