From db3150b3eb3b7dbaa2c75de796c599ad6b055318 Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Wed, 17 Nov 2021 21:04:39 +0100 Subject: [PATCH] crowbar: update with new compare functions --- src/crowbar/opamFilename_crowbar.ml | 6 +++--- src/crowbar/opamHash_crowbar.ml | 2 +- src/crowbar/opamUrl_crowbar.ml | 2 +- src/crowbar/opamVariable_crowbar.ml | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/crowbar/opamFilename_crowbar.ml b/src/crowbar/opamFilename_crowbar.ml index 409876b5335..85dff49220f 100644 --- a/src/crowbar/opamFilename_crowbar.ml +++ b/src/crowbar/opamFilename_crowbar.ml @@ -32,8 +32,8 @@ let filename : t gen = let check () = check_json_roundtrip ~name:"OpamFilename.Base.t" - base (=) Base.to_json Base.of_json; + base (eq_of_comp Base.compare) Base.to_json Base.of_json; check_json_roundtrip ~name:"OpamFilename.Dir.t" - dir (=) Dir.to_json Dir.of_json; + dir (eq_of_comp Dir.compare) Dir.to_json Dir.of_json; check_json_roundtrip ~name:"OpamFilename.t" - filename (=) to_json of_json; + filename (eq_of_comp OpamFilename.compare) to_json of_json; diff --git a/src/crowbar/opamHash_crowbar.ml b/src/crowbar/opamHash_crowbar.ml index d52bca2890b..34bf234367b 100644 --- a/src/crowbar/opamHash_crowbar.ml +++ b/src/crowbar/opamHash_crowbar.ml @@ -23,4 +23,4 @@ let hash = map [kind; bytes] @@ fun kind string -> let check () = check_json_roundtrip ~name:"OpamHash.t" - hash (=) OpamHash.to_json OpamHash.of_json; + hash (eq_of_comp OpamHash.compare) OpamHash.to_json OpamHash.of_json; diff --git a/src/crowbar/opamUrl_crowbar.ml b/src/crowbar/opamUrl_crowbar.ml index 57e65d61abf..d0c606deffd 100644 --- a/src/crowbar/opamUrl_crowbar.ml +++ b/src/crowbar/opamUrl_crowbar.ml @@ -49,4 +49,4 @@ let url : OpamUrl.t gen = map [ let check () = check_json_roundtrip ~name:"OpamUrl.t" - url (=) OpamUrl.to_json OpamUrl.of_json; + url (eq_of_comp OpamUrl.compare) OpamUrl.to_json OpamUrl.of_json; diff --git a/src/crowbar/opamVariable_crowbar.ml b/src/crowbar/opamVariable_crowbar.ml index 68be9200cbc..be5b5812e5c 100644 --- a/src/crowbar/opamVariable_crowbar.ml +++ b/src/crowbar/opamVariable_crowbar.ml @@ -21,6 +21,5 @@ let full = choose [ ] let check () = - let equal v1 v2 = Full.to_string v1 = Full.to_string v2 in check_json_roundtrip ~name:"OpamVariable.t" - full equal Full.to_json Full.of_json; + full (eq_of_comp OpamVariable.Full.compare) Full.to_json Full.of_json;