mirror of
https://github.com/c-cube/iter.git
synced 2025-12-06 19:25:30 -05:00
fix tests
This commit is contained in:
parent
ed5a602f4e
commit
20f70e721f
3 changed files with 18 additions and 8 deletions
4
Makefile
4
Makefile
|
|
@ -40,8 +40,8 @@ configure:
|
||||||
|
|
||||||
# OASIS_STOP
|
# OASIS_STOP
|
||||||
|
|
||||||
tests:
|
run-tests:
|
||||||
ocamlbuild -use-ocamlfind -pkg oUnit tests/run_tests.native
|
./run_tests.native
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
ocamlbuild examples/test_sexpr.native
|
ocamlbuild examples/test_sexpr.native
|
||||||
|
|
|
||||||
11
_oasis
11
_oasis
|
|
@ -46,7 +46,16 @@ Document sequence
|
||||||
|
|
||||||
Test all
|
Test all
|
||||||
Type: custom
|
Type: custom
|
||||||
Command: make tests
|
Command: make run-tests
|
||||||
|
Run$: flag(tests)
|
||||||
|
|
||||||
|
Executable run_tests
|
||||||
|
Path: tests/
|
||||||
|
Install: false
|
||||||
|
CompiledObject: native
|
||||||
|
MainIs: run_tests.ml
|
||||||
|
Build$: flag(tests)
|
||||||
|
BuildDepends: sequence,oUnit
|
||||||
|
|
||||||
Executable benchs
|
Executable benchs
|
||||||
Path: bench
|
Path: bench
|
||||||
|
|
|
||||||
|
|
@ -130,9 +130,10 @@ let test_uniq () =
|
||||||
|
|
||||||
let test_product () =
|
let test_product () =
|
||||||
let stream = Stream.from (fun i -> if i < 3 then Some i else None) in
|
let stream = Stream.from (fun i -> if i < 3 then Some i else None) in
|
||||||
let inner = S.of_stream stream in
|
let a = S.of_stream stream in
|
||||||
let outer = S.of_list ["a";"b";"c"] in
|
let b = S.of_list ["a";"b";"c"] in
|
||||||
let s = S.product outer inner |> S.to_list in
|
let s = S.product a b |> S.map (fun (x,y) -> y,x)
|
||||||
|
|> S.to_list |> List.sort compare in
|
||||||
OUnit.assert_equal ["a",0; "a", 1; "a", 2;
|
OUnit.assert_equal ["a",0; "a", 1; "a", 2;
|
||||||
"b",0; "b", 1; "b", 2;
|
"b",0; "b", 1; "b", 2;
|
||||||
"c",0; "c", 1; "c", 2;] s
|
"c",0; "c", 1; "c", 2;] s
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue