mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-07 03:35:30 -05:00
update implem of CCVector.equal; add a random test
This commit is contained in:
parent
cfad88e906
commit
6639cb8e77
1 changed files with 6 additions and 3 deletions
|
|
@ -247,9 +247,7 @@ let equal eq v1 v2 =
|
|||
&&
|
||||
let n = v1.size in
|
||||
let rec check i =
|
||||
if i = n
|
||||
then true
|
||||
else eq (get v1 i) (get v2 i) && check (i+1)
|
||||
i = n || (eq (get v1 i) (get v2 i) && check (i+1))
|
||||
in
|
||||
check 0
|
||||
|
||||
|
|
@ -260,6 +258,11 @@ let equal eq v1 v2 =
|
|||
not (equal (=) (return 42) (create ()))
|
||||
*)
|
||||
|
||||
(*$Q
|
||||
Q.(let g = list_of_size Gen.(0--10) small_int in pair g g) (fun (l1,l2) -> \
|
||||
equal (=) (of_list l1) (of_list l2) = (l1=l2))
|
||||
*)
|
||||
|
||||
let compare cmp v1 v2 =
|
||||
let n = min v1.size v2.size in
|
||||
let rec check i =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue