fix TestKit.receiveWhile when using implicitly discovered maximum wait

time (i.e. default argument)
This commit is contained in:
Roland 2011-11-03 19:11:15 +01:00
parent 05b9cbc8c7
commit 91bee0370c

View file

@ -477,7 +477,7 @@ class TestKit(_app: AkkaApplication) {
* </pre>
*/
def receiveWhile[T](max: Duration = Duration.MinusInf, idle: Duration = Duration.Inf, messages: Int = Int.MaxValue)(f: PartialFunction[AnyRef, T]): Seq[T] = {
val stop = now + (if (max == Duration.MinusInf) remaining else max.dilated)
val stop = now + (if (max eq Duration.MinusInf) remaining else max.dilated)
var msg: Message = NullMessage
@tailrec