diff options
author | Joffrey Bion <joffrey.bion@gmail.com> | 2021-09-07 00:30:02 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@gmail.com> | 2021-09-07 02:41:42 +0200 |
commit | 0ab3594568c36f64df480cfaccd9e7f7692bfb10 (patch) | |
tree | ce9ca956a51c768a18f3ab1c4053fe15ac359d86 /sw-server/src/test/kotlin/org | |
parent | Use JDK 15 because of Gradle issue on 16 (diff) | |
download | seven-wonders-0ab3594568c36f64df480cfaccd9e7f7692bfb10.tar.gz seven-wonders-0ab3594568c36f64df480cfaccd9e7f7692bfb10.tar.bz2 seven-wonders-0ab3594568c36f64df480cfaccd9e7f7692bfb10.zip |
Upgrade Kotlin, Kotlin/React, and Krossbow versions
Diffstat (limited to 'sw-server/src/test/kotlin/org')
-rw-r--r-- | sw-server/src/test/kotlin/org/luxons/sevenwonders/server/test/ClientEventsAsserts.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/test/ClientEventsAsserts.kt b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/test/ClientEventsAsserts.kt index d87c2122..65711d6d 100644 --- a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/test/ClientEventsAsserts.kt +++ b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/test/ClientEventsAsserts.kt @@ -27,20 +27,20 @@ suspend fun SevenWondersSession.eventAsserter(scope: CoroutineScope): EventAsser return EventAsserter(gameListEvents, gameEvents) } -suspend inline fun EventAsserter.expectNoGameEvent(message: String? = null, timeout: Duration = 50.milliseconds) { +suspend inline fun EventAsserter.expectNoGameEvent(message: String? = null, timeout: Duration = Duration.milliseconds(50)) { val event = withTimeoutOrNull(timeout) { gameEvents.receive() } val extraMessage = message?.let { " ($it)" } ?: "" assertNull(event, "Expected no game event$extraMessage, but received $event") } -suspend inline fun <reified T : GameEvent> EventAsserter.expectGameEvent(timeout: Duration = 1.seconds): T { +suspend inline fun <reified T : GameEvent> EventAsserter.expectGameEvent(timeout: Duration = Duration.seconds(1)): T { val event = withTimeoutOrNull(timeout) { gameEvents.receive() } assertNotNull(event, "Expected event of type ${T::class.simpleName}, received nothing in $timeout") assertTrue(event is T, "Expected event of type ${T::class.simpleName}, received $event") return event } -suspend inline fun <reified T : GameListEvent> EventAsserter.expectGameListEvent(timeout: Duration = 1.seconds): T { +suspend inline fun <reified T : GameListEvent> EventAsserter.expectGameListEvent(timeout: Duration = Duration.seconds(1)): T { val event = withTimeoutOrNull(timeout) { gameListEvents.receive() } assertNotNull(event, "Expected event of type ${T::class.simpleName}, received nothing in $timeout") assertTrue(event is T, "Expected event of type ${T::class.simpleName}, received $event") |