mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
small fix + test
This commit is contained in:
parent
fed7dd41e0
commit
59a463a882
1 changed files with 6 additions and 1 deletions
|
|
@ -162,7 +162,7 @@ let _reverse_in_place a i ~len =
|
|||
done
|
||||
|
||||
let rec _equal eq a1 i1 j1 a2 i2 j2 =
|
||||
if i1 = j1 || i2 = j2
|
||||
if i1 = j1
|
||||
then (assert (i1=j1 && i2=j2); true)
|
||||
else
|
||||
eq a1.(i1) a2.(i2) && _equal eq a1 (i1+1) j1 a2 (i2+2) j2
|
||||
|
|
@ -548,6 +548,11 @@ let equal eq a b =
|
|||
&&
|
||||
_equal eq a 0 (Array.length a) b 0 (Array.length b)
|
||||
|
||||
(*$Q
|
||||
Q.(pair (array small_int)(array small_int)) (fun (a,b) -> \
|
||||
equal (=) a b = equal (=) b a)
|
||||
*)
|
||||
|
||||
let compare cmp a b =
|
||||
_compare cmp a 0 (Array.length a) b 0 (Array.length b)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue