mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
start using qtest
This commit is contained in:
parent
0fc209d4b3
commit
fcde09ca24
2 changed files with 7 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -8,3 +8,4 @@ TAGS
|
||||||
*.docdir
|
*.docdir
|
||||||
setup.log
|
setup.log
|
||||||
setup.data
|
setup.data
|
||||||
|
qtest
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ let snoc l x = make l.front l.f_len (x::l.rear) (l.r_len+1)
|
||||||
let next l = match l.front with
|
let next l = match l.front with
|
||||||
| [] -> assert false
|
| [] -> assert false
|
||||||
| x::l' ->
|
| x::l' ->
|
||||||
x, make l' (l.f_len-1) l.rear l.r_len
|
x, make l' (l.f_len-1) (x::l.rear) (l.r_len+1)
|
||||||
|
|
||||||
let rev l = make l.rear l.r_len l.front l.f_len
|
let rev l = make l.rear l.r_len l.front l.f_len
|
||||||
|
|
||||||
|
|
@ -80,6 +80,11 @@ let exists p l = match find p l with
|
||||||
| None -> false
|
| None -> false
|
||||||
| Some _ -> true
|
| Some _ -> true
|
||||||
|
|
||||||
|
(*$T
|
||||||
|
exists (fun x-> x mod 2 = 0) (of_list [1;3;5;7;8])
|
||||||
|
not (exists (fun x-> x mod 2 = 0) (of_list [1;3;5;7;9]))
|
||||||
|
*)
|
||||||
|
|
||||||
let for_all p l =
|
let for_all p l =
|
||||||
let rec _check i l =
|
let rec _check i l =
|
||||||
i = 0 ||
|
i = 0 ||
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue