Skip to content

Commit

Permalink
crowbar: update with new compare functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbou committed Nov 19, 2021
1 parent d006e15 commit db3150b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/crowbar/opamFilename_crowbar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion src/crowbar/opamHash_crowbar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion src/crowbar/opamUrl_crowbar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
3 changes: 1 addition & 2 deletions src/crowbar/opamVariable_crowbar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit db3150b

Please sign in to comment.