add additional coverage for possible case

This commit is contained in:
Jonas Chapuis 2018-10-02 22:34:13 +02:00
parent 41c59fdf48
commit 375c1f8365

View file

@ -202,6 +202,24 @@ class GraphZipLatestSpec
} }
} }
"complete when one source completes and the other continues pushing" in {
val (probe, bools, ints) = testGraph[Boolean, Int]
Given("one element pushed on each source")
bools.sendNext(true)
ints.sendNext(1)
And("either source completes")
bools.sendComplete()
ints.sendNext(10)
ints.sendNext(10)
Then("should emit first element then complete")
probe.requestNext((true, 1))
probe.expectComplete()
}
"complete if no pending demand" in { "complete if no pending demand" in {
forAll(Gen.oneOf(first, second)) { select forAll(Gen.oneOf(first, second)) { select
val (probe, bools, ints) = testGraph[Boolean, Int] val (probe, bools, ints) = testGraph[Boolean, Int]