From 375c1f8365915822b3c7d11d2e389f28cea1fabb Mon Sep 17 00:00:00 2001 From: Jonas Chapuis Date: Tue, 2 Oct 2018 22:34:13 +0200 Subject: [PATCH] add additional coverage for possible case --- .../stream/scaladsl/GraphZipLatestSpec.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphZipLatestSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphZipLatestSpec.scala index f7e1bbe37e..bc4bd05f4a 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphZipLatestSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/GraphZipLatestSpec.scala @@ -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 { forAll(Gen.oneOf(first, second)) { select ⇒ val (probe, bools, ints) = testGraph[Boolean, Int]