mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-20 19:09:12 +08:00
Fix build
This commit is contained in:
parent
41f1c12c8a
commit
a662362131
@ -9,10 +9,7 @@
|
|||||||
|
|
||||||
package net.mamoe.mirai.message
|
package net.mamoe.mirai.message
|
||||||
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.*
|
||||||
import kotlinx.coroutines.TimeoutCancellationException
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import kotlinx.coroutines.withTimeout
|
|
||||||
import net.mamoe.mirai.event.TestEvent
|
import net.mamoe.mirai.event.TestEvent
|
||||||
import net.mamoe.mirai.event.broadcast
|
import net.mamoe.mirai.event.broadcast
|
||||||
import net.mamoe.mirai.event.syncFromEvent
|
import net.mamoe.mirai.event.syncFromEvent
|
||||||
@ -20,7 +17,6 @@ import net.mamoe.mirai.test.runBlocking
|
|||||||
import kotlin.coroutines.CoroutineContext
|
import kotlin.coroutines.CoroutineContext
|
||||||
import kotlin.coroutines.EmptyCoroutineContext
|
import kotlin.coroutines.EmptyCoroutineContext
|
||||||
import kotlin.coroutines.resume
|
import kotlin.coroutines.resume
|
||||||
import kotlin.coroutines.suspendCoroutine
|
|
||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
import kotlin.test.assertFailsWith
|
import kotlin.test.assertFailsWith
|
||||||
|
|
||||||
@ -29,7 +25,7 @@ internal class SubscribingGetTest {
|
|||||||
@Test
|
@Test
|
||||||
fun testSyncFromEvent(): Unit = runBlocking {
|
fun testSyncFromEvent(): Unit = runBlocking {
|
||||||
withTimeout(500) {
|
withTimeout(500) {
|
||||||
suspendCoroutine<Unit> { cont ->
|
suspendCancellableCoroutine<Unit> { cont ->
|
||||||
launch {
|
launch {
|
||||||
syncFromEvent(5000) { _: TestEvent ->
|
syncFromEvent(5000) { _: TestEvent ->
|
||||||
cont.resume(Unit)
|
cont.resume(Unit)
|
||||||
|
Loading…
Reference in New Issue
Block a user