Test for invalid child nodes
This commit is contained in:
1 parent
397ab17e64
commit
0a71730bdc
2 files changed
+14
No files matched your search
@@ -36,6 +36,13 @@ public class ArgumentCommandNodeTest {
|
|||||||
assertThat(node.parse("123 123"), is(child));
|
assertThat(node.parse("123 123"), is(child));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(expected = IllegalCommandArgumentException.class)
|
||||||
|
public void testParseInvalidChild() throws Exception {
|
||||||
|
node.addChild(argument("bar", integer()).build());
|
||||||
|
|
||||||
|
node.parse("123 bar");
|
||||||
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalCommandArgumentException.class)
|
@Test(expected = IllegalCommandArgumentException.class)
|
||||||
public void testParseNoChildren() throws Exception {
|
public void testParseNoChildren() throws Exception {
|
||||||
node.parse("123 123");
|
node.parse("123 123");
|
||||||
|
|||||||
@@ -37,6 +37,13 @@ public class LiteralCommandNodeTest {
|
|||||||
assertThat(node.parse("foo 123"), is(child));
|
assertThat(node.parse("foo 123"), is(child));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(expected = IllegalCommandArgumentException.class)
|
||||||
|
public void testParseInvalidChild() throws Exception {
|
||||||
|
node.addChild(argument("bar", integer()).build());
|
||||||
|
|
||||||
|
node.parse("foo bar");
|
||||||
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalCommandArgumentException.class)
|
@Test(expected = IllegalCommandArgumentException.class)
|
||||||
public void testParseNoChildren() throws Exception {
|
public void testParseNoChildren() throws Exception {
|
||||||
node.parse("foo 123");
|
node.parse("foo 123");
|
||||||
|
|||||||
Reference in new issue
Block a user