You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2024/03/23 10:56:23 UTC

[PR] chore: Fix expectNextWithTimeoutPF [pekko]

He-Pin opened a new pull request, #1218:
URL: https://github.com/apache/pekko/pull/1218

   Motivaition:
   Fix https://github.com/apache/pekko/issues/1217
   


-- 
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-unsubscribe@pekko.apache.org

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


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


Re: [PR] chore: Fix expectNextWithTimeoutPF [pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin merged PR #1218:
URL: https://github.com/apache/pekko/pull/1218


-- 
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-unsubscribe@pekko.apache.org

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


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


Re: [PR] chore: Fix expectNextWithTimeoutPF [pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #1218:
URL: https://github.com/apache/pekko/pull/1218#discussion_r1536614636


##########
stream-testkit/src/main/scala/org/apache/pekko/stream/testkit/StreamTestKit.scala:
##########
@@ -852,10 +852,10 @@ object TestSubscriber {
      * @param max wait no more than max time, otherwise throw AssertionError
      */
     def expectNextWithTimeoutPF[T](max: Duration, f: PartialFunction[Any, T]): T = {
-      val pf: PartialFunction[SubscriberEvent, Any] = {
-        case OnNext(n) => n
+      val pf: PartialFunction[SubscriberEvent, T] = {
+        case OnNext(n) if f.isDefinedAt(n) => f(n)
       }
-      expectEventWithTimeoutPF(max, pf.andThen(f))
+      expectEventWithTimeoutPF[T](max, pf)

Review Comment:
   It was only supported on Scala 2.13 :(



-- 
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-unsubscribe@pekko.apache.org

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


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