diff --git a/test/lib/test_contributions.ml b/test/lib/test_contributions.ml index b91326f..1c760e7 100644 --- a/test/lib/test_contributions.ml +++ b/test/lib/test_contributions.ml @@ -66,9 +66,16 @@ module Testable = struct (Repo_map.pp (Format.pp_print_list Item.pp)) x.activity + (* [List.equal] requires OCaml >= 4.12 *) + let list_equal eq lx ly = + try + List.iter2 (fun x y -> if not (eq x y) then failwith "not equal") lx ly; + true + with _ -> false + let eq (x : t) (y : t) = String.equal x.username y.username - && Repo_map.eq (List.equal Item.eq) x.activity y.activity + && Repo_map.eq (list_equal Item.eq) x.activity y.activity let testable = Alcotest.testable pp eq end