chore: Fix expectNextWithTimeoutPF (#1218)
This commit is contained in:
parent
e3410bcaa8
commit
33a845a9e9
1 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue