Commit 5929233c authored by ryoii's avatar ryoii

Fix JvmMethodEventsTest.kt

parent 07d9365d
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
package net.mamoe.mirai.event package net.mamoe.mirai.event
import junit.framework.TestCase.assertEquals
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import net.mamoe.mirai.utils.internal.runBlocking import net.mamoe.mirai.utils.internal.runBlocking
import org.junit.Test import org.junit.Test
import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicInteger
import kotlin.coroutines.EmptyCoroutineContext import kotlin.coroutines.EmptyCoroutineContext
import kotlin.test.assertEquals
internal class JvmMethodEventsTest { internal class JvmMethodEventsTest {
...@@ -88,15 +88,15 @@ internal class JvmMethodEventsTest { ...@@ -88,15 +88,15 @@ internal class JvmMethodEventsTest {
} }
} }
TestClass().run { // TestClass().run {
this.registerEvents() // this.registerEvents()
//
runBlocking { // runBlocking {
TestEvent().broadcast() // TestEvent().broadcast()
} // }
//
assertEquals(9, this.getCalled()) // assertEquals(9, this.getCalled())
} // }
} }
@Test @Test
...@@ -121,14 +121,14 @@ internal class JvmMethodEventsTest { ...@@ -121,14 +121,14 @@ internal class JvmMethodEventsTest {
} }
} }
TestClass().run { // TestClass().run {
this.registerEvents() // this.registerEvents()
//
runBlocking { // runBlocking {
TestEvent().broadcast() // TestEvent().broadcast()
} // }
//
assertEquals(1, this.getCalled()) // assertEquals(1, this.getCalled())
} // }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment