From f92455442dba524ceab01ddf1ed099da277d1062 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Wed, 17 Feb 2016 15:39:18 +0100 Subject: [PATCH] Minor: Unit testing: don't always require a lambda when running the network synchronously. --- src/test/kotlin/core/messaging/InMemoryMessagingTests.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/kotlin/core/messaging/InMemoryMessagingTests.kt b/src/test/kotlin/core/messaging/InMemoryMessagingTests.kt index e6cdc5ae43..591f0781a0 100644 --- a/src/test/kotlin/core/messaging/InMemoryMessagingTests.kt +++ b/src/test/kotlin/core/messaging/InMemoryMessagingTests.kt @@ -48,9 +48,13 @@ open class TestWithInMemoryNetwork { // Keep calling "pump" in rounds until every node in the network reports that it had nothing to do fun runNetwork(body: () -> T): T { val result = body() - while (pumpAll(false).any { it }) {} + runNetwork() return result } + + fun runNetwork() { + while (pumpAll(false).any { it }) {} + } } class InMemoryMessagingTests : TestWithInMemoryNetwork() {