Skip to content

Commit fde1ed9

Browse files
committed
fix: make doTest suspendable and initialize bot config
Updated `doTest` to be a suspend function to support coroutine usage. Added `initConfiguration` call to ensure bot configuration is properly initialized before use. This improves reliability and aligns with the required setup process.
1 parent 1ce66f7 commit fde1ed9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonTest/kotlin/love/forte/simbot/component/onebot/v11/core/bot/BotDecoderFromCustomComponentTests.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class BotDecoderFromCustomComponentTests {
6060
assertEquals("test", testSeg.data!!.jsonPrimitive.content)
6161
}
6262

63-
private fun doTest(app: Application): OneBotMessageSegment {
63+
private suspend fun doTest(app: Application): OneBotMessageSegment {
6464
app.oneBot11Bots {
6565
val bot = register(
6666
OneBotBotConfiguration().apply {
@@ -73,6 +73,7 @@ class BotDecoderFromCustomComponentTests {
7373
}
7474
}
7575
)
76+
bot.initConfiguration()
7677

7778
val segments = doSerial(bot)
7879
assertEquals(3, segments.size)

0 commit comments

Comments
 (0)