/test_List.ml

http://github.com/alanfalloon/ocaml-quickcheck · OCaml · 17 lines · 12 code · 2 blank · 3 comment · 0 complexity · f999e3e61183a6a5deaf63961f1e117b MD5 · raw file

  1. open QuickCheck
  2. let prop_revrev : 'a list -> bool =
  3. fun xs -> List.rev (List.rev xs) = xs
  4. (* for generating random int lists *)
  5. module AL = Arbitrary_list(Arbitrary_int) ;;
  6. (* for printing out int lists *)
  7. module SL = PShow_list(PShow_int) ;;
  8. (* for being able to test (int list -> bool) *)
  9. module Testable_list_to_bool =
  10. Testable_fun
  11. (AL)
  12. (SL)
  13. (Testable_bool) ;;
  14. module C = Check(Testable_list_to_bool)
  15. let () = C.quickCheck prop_revrev