mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-07 11:45:31 -05:00
Adds tests for split function.
This commit is contained in:
parent
973062158a
commit
7a9a741bb0
1 changed files with 15 additions and 0 deletions
|
|
@ -1393,3 +1393,18 @@ let split l =
|
||||||
in
|
in
|
||||||
direct direct_depth_default_ l
|
direct direct_depth_default_ l
|
||||||
|
|
||||||
|
(*$Q
|
||||||
|
(Q.(list (pair int string))) (fun l -> \
|
||||||
|
let (l1, l2) = split l in \
|
||||||
|
List.length l1 = List.length l \
|
||||||
|
&& List.length l2 = List.length l)
|
||||||
|
|
||||||
|
(Q.(list (pair string int))) (fun l -> \
|
||||||
|
let l = ("hello", 10) :: l in \
|
||||||
|
let (l1, l2) = split l in \
|
||||||
|
let i = Random.int @@ List.length l in \
|
||||||
|
let l1_x = List.nth l1 i in \
|
||||||
|
let l2_y = List.nth l2 i in \
|
||||||
|
let (x,y) = List.nth l i in \
|
||||||
|
l1_x = x && l2_y = y)
|
||||||
|
*)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue