mirror of
https://github.com/c-cube/iter.git
synced 2026-01-28 12:04:50 -05:00
add a test
This commit is contained in:
parent
5a3c20464d
commit
35c32b1a32
1 changed files with 14 additions and 0 deletions
|
|
@ -208,6 +208,19 @@ let test_take () =
|
||||||
OUnit.assert_equal ~printer:pp_ilist [1;2;3;4;5] l;
|
OUnit.assert_equal ~printer:pp_ilist [1;2;3;4;5] l;
|
||||||
()
|
()
|
||||||
|
|
||||||
|
let test_for_all () =
|
||||||
|
OUnit.assert_bool "true" S.(for_all (fun x -> x < 10) (1--9));
|
||||||
|
OUnit.assert_bool "false" S.(not (for_all (fun x -> x < 10) (2--11)));
|
||||||
|
OUnit.assert_bool "true" S.(for_all (fun _ -> false) empty);
|
||||||
|
OUnit.assert_bool "nested"
|
||||||
|
S.(
|
||||||
|
for_all
|
||||||
|
(fun seq ->
|
||||||
|
not (for_all (fun x -> x < 8) seq)
|
||||||
|
) (1 -- 10 >|= fun x -> x--20)
|
||||||
|
);
|
||||||
|
()
|
||||||
|
|
||||||
let test_regression1 () =
|
let test_regression1 () =
|
||||||
let s = S.(take 10 (repeat 1)) in
|
let s = S.(take 10 (repeat 1)) in
|
||||||
OUnit.assert_bool "not empty" (not (S.is_empty s));
|
OUnit.assert_bool "not empty" (not (S.is_empty s));
|
||||||
|
|
@ -245,5 +258,6 @@ let suite =
|
||||||
"test_take" >:: test_take;
|
"test_take" >:: test_take;
|
||||||
"test_fold_while" >:: test_fold_while;
|
"test_fold_while" >:: test_fold_while;
|
||||||
"test_buff" >:: test_buff;
|
"test_buff" >:: test_buff;
|
||||||
|
"test_for_all" >:: test_for_all;
|
||||||
"test_regression1" >:: test_regression1;
|
"test_regression1" >:: test_regression1;
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue