mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-09 12:45:34 -05:00
test: add regression test for #256
This commit is contained in:
parent
a325600ccb
commit
1654f8c826
1 changed files with 12 additions and 0 deletions
|
|
@ -328,6 +328,18 @@ let init len f =
|
|||
init 1000 (fun x->x) = 0--999
|
||||
*)
|
||||
|
||||
(* see: #256 *)
|
||||
(*$R
|
||||
let r = ref [] in
|
||||
ignore (CCList.init 5 (fun x -> r := x :: !r; ()));
|
||||
assert_equal ~printer:Q.Print.(list int) (List.rev !r) [0;1;2;3;4]
|
||||
*)
|
||||
(*$R
|
||||
let r = ref [] in
|
||||
ignore (CCList.init 200_000 (fun x -> r := x :: !r; ()));
|
||||
assert_equal ~printer:Q.Print.(list int) (List.rev !r) (0--(200_000-1))
|
||||
*)
|
||||
|
||||
let rec compare f l1 l2 = match l1, l2 with
|
||||
| [], [] -> 0
|
||||
| _, [] -> 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue