tests/pipeline_test.oxl
use super.pipeline { scaled, running, groups, collect }
test "scaled drops repeats and small values" {
assert_eq(collect(scaled(5)), [80, 150, 160, 230, 420])
}
test "running is a prefix sum" {
let sums = collect(running())
assert_eq(sums[0], 3)
assert_eq(sums[sums.len() - 1], 130)
}
test "groups hold at most n readings" {
var sizes: List<usize> = []
for await g in groups(4) { sizes.push(g.len()) }
assert_eq(sizes, [4, 4, 2])
}Исходник: examples/streams/tests/pipeline_test.oxl