fix tests

This commit is contained in:
Simon Cruanes 2014-07-07 14:02:53 +02:00
parent ed5a602f4e
commit 20f70e721f
3 changed files with 18 additions and 8 deletions

View file

@ -40,8 +40,8 @@ configure:
# OASIS_STOP
tests:
ocamlbuild -use-ocamlfind -pkg oUnit tests/run_tests.native
run-tests:
./run_tests.native
examples:
ocamlbuild examples/test_sexpr.native

15
_oasis
View file

@ -9,7 +9,7 @@ Plugins: META (0.3), DevFiles (0.3)
BuildTools: ocamlbuild
Synopsis: Simple sequence (iterator) datatype and combinators
Description:
Description:
Simple sequence datatype, intended to transfer a finite number of
elements from one data structure to another. Some transformations on sequences,
like `filter`, `map`, `take`, `drop` and `append` can be performed before the
@ -25,7 +25,7 @@ Flag invert
Library "sequence"
Path: .
Modules: Sequence
Modules: Sequence
Library "invert"
Path: invert
@ -46,7 +46,16 @@ Document sequence
Test all
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
Path: bench

View file

@ -130,9 +130,10 @@ let test_uniq () =
let test_product () =
let stream = Stream.from (fun i -> if i < 3 then Some i else None) in
let inner = S.of_stream stream in
let outer = S.of_list ["a";"b";"c"] in
let s = S.product outer inner |> S.to_list in
let a = S.of_stream stream in
let b = S.of_list ["a";"b";"c"] 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;
"b",0; "b", 1; "b", 2;
"c",0; "c", 1; "c", 2;] s