-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
429a4e6
commit 2d7bc45
Showing
4 changed files
with
80 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
> 对应核心版本: [**v4.1.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.1.0) | ||
|
||
我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-onebot/issues)或[协助](https://github.com/simple-robot/simbot-component-onebot/pulls), | ||
感谢您的贡献与支持! | ||
|
||
也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
.../kotlin/love/forte/simbot/component/onebot/v11/core/utils/ReplyMessageSegmentListTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package love.forte.simbot.component.onebot.v11.core.utils | ||
|
||
import love.forte.simbot.common.id.IntID.Companion.ID | ||
import love.forte.simbot.component.onebot.v11.message.segment.OneBotAt | ||
import love.forte.simbot.component.onebot.v11.message.segment.OneBotDice | ||
import love.forte.simbot.component.onebot.v11.message.segment.OneBotReply | ||
import kotlin.test.Test | ||
import kotlin.test.assertContentEquals | ||
import kotlin.test.assertEquals | ||
import kotlin.test.assertIs | ||
|
||
|
||
/** | ||
* | ||
* @author ForteScarlet | ||
*/ | ||
class ReplyMessageSegmentListTests { | ||
|
||
@Test | ||
fun resolveReplyMessageSegmentListWithoutReplyTest() { | ||
val list = listOf( | ||
OneBotAt.create("1"), | ||
OneBotAt.createAtAll(), | ||
OneBotDice, | ||
) | ||
|
||
val newList = resolveReplyMessageSegmentList(list, 0.ID) | ||
|
||
assertEquals(4, newList.size) | ||
assertIs<OneBotReply>(newList.first()) | ||
assertContentEquals(list, newList.subList(1, newList.size)) | ||
} | ||
|
||
@Test | ||
fun resolveReplyMessageSegmentListWithReplyTest() { | ||
val list = listOf( | ||
OneBotAt.create("1"), | ||
OneBotReply.create(10.ID), | ||
OneBotDice, | ||
) | ||
|
||
val newList = resolveReplyMessageSegmentList(list, 0.ID) | ||
|
||
println(newList) | ||
|
||
assertEquals(3, newList.size) | ||
assertContentEquals(list, newList) | ||
} | ||
|
||
} |