File tree 2 files changed +18
-1
lines changed
stream/src/main/scala/org/apache/pekko/stream/impl
stream-tests/src/test/scala/org/apache/pekko/stream/impl
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import org.apache.pekko
17
17
import pekko .NotUsed
18
18
import pekko .stream ._
19
19
import pekko .stream .impl .TraversalTestUtils ._
20
- import pekko .stream .scaladsl .Keep
20
+ import pekko .stream .scaladsl .{ Keep , Source }
21
21
import pekko .testkit .PekkoSpec
22
22
23
23
class TraversalBuilderSpec extends PekkoSpec {
@@ -447,4 +447,20 @@ class TraversalBuilderSpec extends PekkoSpec {
447
447
}
448
448
}
449
449
450
+ " find Source.empty via TraversalBuilder with isEmptySource" in {
451
+ val emptySource = EmptySource
452
+ TraversalBuilder .isEmptySource(emptySource) should be(true )
453
+ }
454
+
455
+ " find javadsl Source.empty via TraversalBuilder with isEmptySource" in {
456
+ import pekko .stream .javadsl .Source
457
+ val emptySource = Source .empty()
458
+ TraversalBuilder .isEmptySource(emptySource) should be(true )
459
+ }
460
+
461
+ " find scaldsl Source.empty via TraversalBuilder with isEmptySource" in {
462
+ val emptySource = Source .empty
463
+ TraversalBuilder .isEmptySource(emptySource) should be(true )
464
+ }
465
+
450
466
}
Original file line number Diff line number Diff line change @@ -386,6 +386,7 @@ import pekko.util.unused
386
386
def isEmptySource (graph : Graph [SourceShape [_], _]): Boolean = graph match {
387
387
case source : scaladsl.Source [_, _] if source eq scaladsl.Source .empty => true
388
388
case source : javadsl.Source [_, _] if source eq javadsl.Source .empty() => true
389
+ case EmptySource => true
389
390
case _ => false
390
391
}
391
392
You can’t perform that action at this time.
0 commit comments