mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2026-01-27 11:24:50 -05:00
more tests
This commit is contained in:
parent
9f48725a06
commit
5720120fa1
1 changed files with 9 additions and 0 deletions
|
|
@ -1021,6 +1021,7 @@ let uniq ~eq l =
|
||||||
in uniq eq [] l
|
in uniq eq [] l
|
||||||
|
|
||||||
(*$T
|
(*$T
|
||||||
|
uniq ~eq:CCInt.equal [1;2;3] |> List.sort Pervasives.compare = [1;2;3]
|
||||||
uniq ~eq:CCInt.equal [1;1;2;2;3;4;4;2;4;1;5] |> List.sort Pervasives.compare = [1;2;3;4;5]
|
uniq ~eq:CCInt.equal [1;1;2;2;3;4;4;2;4;1;5] |> List.sort Pervasives.compare = [1;2;3;4;5]
|
||||||
*)
|
*)
|
||||||
|
|
||||||
|
|
@ -1458,6 +1459,10 @@ let of_seq seq =
|
||||||
seq (fun x -> l := x :: !l);
|
seq (fun x -> l := x :: !l);
|
||||||
List.rev !l
|
List.rev !l
|
||||||
|
|
||||||
|
(*$Q
|
||||||
|
Q.(list int) (fun l -> of_seq (to_seq l) = l)
|
||||||
|
*)
|
||||||
|
|
||||||
let to_gen l =
|
let to_gen l =
|
||||||
let l = ref l in
|
let l = ref l in
|
||||||
fun () ->
|
fun () ->
|
||||||
|
|
@ -1478,6 +1483,10 @@ let of_gen g =
|
||||||
in
|
in
|
||||||
direct direct_depth_default_ g
|
direct direct_depth_default_ g
|
||||||
|
|
||||||
|
(*$Q
|
||||||
|
Q.(list int) (fun l -> of_gen(to_gen l) = l)
|
||||||
|
*)
|
||||||
|
|
||||||
let to_klist l =
|
let to_klist l =
|
||||||
let rec make l () = match l with
|
let rec make l () = match l with
|
||||||
| [] -> `Nil
|
| [] -> `Nil
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue