Test for invalid child nodes
This commit is contained in:
@@ -37,6 +37,13 @@ public class LiteralCommandNodeTest {
|
||||
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)
|
||||
public void testParseNoChildren() throws Exception {
|
||||
node.parse("foo 123");
|
||||
|
||||
Reference in New Issue
Block a user