Add tests for windowed and chunked, fix precondition checks

This commit is contained in:
Ilya Gorbunov
2017-05-04 11:03:00 +03:00
parent a3a1c391cc
commit 18c7a01ab5
7 changed files with 204 additions and 5 deletions
@@ -585,6 +585,7 @@ fun generators(): List<GenericFunction> {
returns(Sequences) { "Sequence<R>" }
body(Sequences) {
"""
require(size > 0 && step > 0) { "size ${"$"}size and step ${"$"}step both must be greater than zero" }
return Sequence { windowForwardOnlySequenceImpl(iterator(), size, step, dropTrailing = false).iterator() }.map(transform)
"""
}