mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -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
|
||||
setup.log
|
||||
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
|
||||
| [] -> assert false
|
||||
| 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
|
||||
|
||||
|
|
@ -80,6 +80,11 @@ let exists p l = match find p l with
|
|||
| None -> false
|
||||
| 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 rec _check i l =
|
||||
i = 0 ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue