Skip to content

Commit

Permalink
actually add the module
Browse files Browse the repository at this point in the history
  • Loading branch information
just-max committed May 13, 2024
1 parent 539e1ee commit 2b32279
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test-lib/test_util.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

(** Check if two lists contain the same items with the same multiplicities,
but in any order. Consider items equal if [eq x y] (default: [x = y]) holds. *)
let rec equal_unordered ?(eq = (=)) xs ys =
match xs with
| [] -> ys = []
| x :: xs' ->
match List.partition (eq x) ys with
| [], _ -> false
| _ :: ys1', ys2' -> equal_unordered ~eq xs' (ys1' @ ys2')

0 comments on commit 2b32279

Please sign in to comment.