Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Librazy committed Feb 6, 2019
1 parent 239be4f commit 351f5cf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/test/java/cat/nyaa/nyaacore/ArgumentsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class ArgumentsTest {
@Test
public void test1() throws Exception {
String cmd = "`foo bar` far `bar \\`foo`";
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "));
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "), null);
assertNotNull(arg);
assertEquals("foo bar", arg.nextString());
assertEquals("far", arg.nextString());
Expand All @@ -18,7 +18,7 @@ public void test1() throws Exception {
@Test
public void test2() throws Exception {
String cmd = "key:33 a key:66 b key:13 `key2:a b c` `key 3:d e f`";
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "));
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "), null);
assertNotNull(arg);
assertEquals("key:33", arg.nextString());
assertEquals(66, arg.argInt("key"));
Expand All @@ -34,7 +34,7 @@ public void test2() throws Exception {
@Test
public void test3() throws Exception {
String cmd = "t w key:`3` key2:`/co l u:miu_bug` ke3y:`12`";
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "));
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "), null);
assertNotNull(arg);
assertEquals(3, arg.argInt("key"));
assertEquals("/co l u:miu_bug", arg.argString("key2"));
Expand All @@ -51,14 +51,14 @@ public void test3() throws Exception {
@Test
public void test4() throws Exception {
String cmd = "key :`3`";
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "));
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "), null);
assertNull(arg);
}

@Test
public void test5() throws Exception {
String cmd = "key: `3`";
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "));
CommandReceiver.Arguments arg = CommandReceiver.Arguments.parse(cmd.split(" "), null);
assertNotNull(arg);
assertEquals("key:", arg.top());
assertEquals("", arg.argString("key"));
Expand Down

0 comments on commit 351f5cf

Please sign in to comment.