Skip to content

Commit

Permalink
test unsigned_lt
Browse files Browse the repository at this point in the history
  • Loading branch information
dlesbre committed Apr 30, 2024
1 parent d40d47f commit 4806ca9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions patriciaTreeTest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ let () = QCheck.Test.check_exn @@
QCheck.Test.make ~count:1000 ~name:"highest_bit" QCheck.int (fun x ->
check_highest_bit x (highest_bit x))

let unsigned_lt_ref x y =
if x >= 0 && y >= 0
then x < y
else if x >= 0
then (* pos < neg *) true
else if y >= 0 then false
else x < y

let () = QCheck.Test.check_exn @@
QCheck.Test.make ~count:1000 ~name:"unsigned_lt" QCheck.(pair int int) (fun (x,y) ->
unsigned_lt x y = unsigned_lt_ref x y)

let%test_module "TestHeterogeneous" = (module struct

module MyKey = struct
Expand Down

0 comments on commit 4806ca9

Please sign in to comment.