mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-30 06:37:36 +00:00
[Add] 增加对 BotCode 的单元测试类;
This commit is contained in:
parent
0d1c651ff4
commit
6570889c1e
26
src/test/java/net/lamgc/cgj/pixiv/BotCodeTest.java
Normal file
26
src/test/java/net/lamgc/cgj/pixiv/BotCodeTest.java
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package net.lamgc.cgj.pixiv;
|
||||||
|
|
||||||
|
import net.lamgc.cgj.bot.BotCode;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class BotCodeTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void parseTest() {
|
||||||
|
System.out.println(BotCode.parse("[CQ:at,qq=1020304050]").toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
public void badHeaderTest() {
|
||||||
|
BotCode.parse("[,qq=12345]");
|
||||||
|
Assert.fail("Parser success");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
public void badFunctionNameTest() {
|
||||||
|
BotCode.parse("[CQ:,qq=12345]");
|
||||||
|
Assert.fail("Parser success");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user