-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix OnQuestionMarkReply false-trigger, add 尊嘟假嘟
- Loading branch information
Showing
5 changed files
with
94 additions
and
26 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
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
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
35 changes: 35 additions & 0 deletions
35
...cala/cc/sukazyo/cono/morny/test/cc/sukazyo/cono/morny/event/OnQuestionMarkReplyTest.scala
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,35 @@ | ||
package cc.sukazyo.cono.morny.test.cc.sukazyo.cono.morny.event | ||
|
||
import cc.sukazyo.cono.morny.bot.event.OnQuestionMarkReply | ||
import cc.sukazyo.cono.morny.test.MornyTests | ||
import org.scalatest.prop.TableDrivenPropertyChecks | ||
|
||
class OnQuestionMarkReplyTest extends MornyTests with TableDrivenPropertyChecks { | ||
|
||
"on replying a question mark :" - { | ||
|
||
"on checking if a message is a question mark :" - { | ||
|
||
val examples = Table( | ||
("text", "is"), | ||
("回来了", false), | ||
("为什么?", false), | ||
("?这不合理", false), | ||
("??尊嘟假嘟", false), | ||
("?????", true), | ||
("?", true), | ||
("?", true), | ||
("??❔", true), | ||
) | ||
forAll(examples) { (text, is) => | ||
|
||
s"$text should checked with result $is" in: | ||
OnQuestionMarkReply.isAllMessageMark(using text) shouldEqual is | ||
|
||
} | ||
|
||
} | ||
|
||
} | ||
|
||
} |