mirror of
https://github.com/c-cube/iter.git
synced 2025-12-06 11:15:32 -05:00
more tests
This commit is contained in:
parent
b4ea152014
commit
bd7ecf0b96
1 changed files with 10 additions and 0 deletions
10
tests.ml
10
tests.ml
|
|
@ -14,6 +14,16 @@ let _ =
|
||||||
(Sequence.filter (fun x -> x mod 2 = 0) (Sequence.List.to_seq l)) in
|
(Sequence.filter (fun x -> x mod 2 = 0) (Sequence.List.to_seq l)) in
|
||||||
let l'' = Sequence.List.of_seq
|
let l'' = Sequence.List.of_seq
|
||||||
(Sequence.take 3 (Sequence.drop 1 (Sequence.List.to_seq l))) in
|
(Sequence.take 3 (Sequence.drop 1 (Sequence.List.to_seq l))) in
|
||||||
|
let h = Hashtbl.create 3 in
|
||||||
|
for i = 0 to 5 do
|
||||||
|
Hashtbl.add h i (i*i);
|
||||||
|
done;
|
||||||
|
let l2 = Sequence.List.of_seq
|
||||||
|
(Sequence.map (fun (x, y) -> (string_of_int x) ^ " -> " ^ (string_of_int y))
|
||||||
|
(Sequence.Hashtbl.to_seq h))
|
||||||
|
in
|
||||||
Format.printf "l=@[<h>[%a]@]@." (pp_list Format.pp_print_int) l;
|
Format.printf "l=@[<h>[%a]@]@." (pp_list Format.pp_print_int) l;
|
||||||
Format.printf "l'=@[<h>[%a]@]@." (pp_list Format.pp_print_int) l';
|
Format.printf "l'=@[<h>[%a]@]@." (pp_list Format.pp_print_int) l';
|
||||||
Format.printf "l''=@[<h>[%a]@]@." (pp_list Format.pp_print_int) l'';
|
Format.printf "l''=@[<h>[%a]@]@." (pp_list Format.pp_print_int) l'';
|
||||||
|
Format.printf "l2=@[<h>[%a]@]@." (pp_list Format.pp_print_string) l2;
|
||||||
|
()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue