He-Pin commented on code in PR #1701:
URL: https://github.com/apache/pekko/pull/1701#discussion_r1910319857


##########
stream-tests/src/test/scala/org/apache/pekko/stream/impl/TraversalBuilderSpec.scala:
##########
@@ -447,4 +452,93 @@ class TraversalBuilderSpec extends PekkoSpec {
     }
   }
 
+  "find Source.single via TraversalBuilder" in {
+    TraversalBuilder.getSingleSource(Source.single("a")).get.elem should 
===("a")
+    TraversalBuilder.getSingleSource(Source(List("a", "b"))) should 
be(OptionVal.None)
+
+    val singleSourceA = new SingleSource("a")
+    TraversalBuilder.getSingleSource(singleSourceA) should 
be(OptionVal.Some(singleSourceA))
+
+    TraversalBuilder.getSingleSource(Source.single("c").async) should 
be(OptionVal.None)
+    TraversalBuilder.getSingleSource(Source.single("d").mapMaterializedValue(_ 
=> "Mat")) should be(OptionVal.None)
+  }
+
+  "find Source.single via TraversalBuilder with getValuePresentedSource" in {
+    
TraversalBuilder.getValuePresentedSource(Source.single("a")).get.asInstanceOf[SingleSource[String]].elem
 should ===(
+      "a")
+    val singleSourceA = new SingleSource("a")
+    TraversalBuilder.getValuePresentedSource(singleSourceA) should 
be(OptionVal.Some(singleSourceA))
+
+    TraversalBuilder.getValuePresentedSource(Source.single("c").async) should 
be(OptionVal.None)
+    
TraversalBuilder.getValuePresentedSource(Source.single("d").mapMaterializedValue(_
 => "Mat")) should be(
+      OptionVal.None)
+  }
+
+  "find Source.empty via TraversalBuilder with getValuePresentedSource" in {
+    val emptySource = EmptySource

Review Comment:
   @pjfanning the tests coverage is here for the `EmptySource`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org
For additional commands, e-mail: notifications-h...@pekko.apache.org

Reply via email to