Parse into nested arguments
This commit is contained in:
@@ -4,7 +4,9 @@ import net.minecraft.commands.exceptions.IllegalCommandArgumentException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static net.minecraft.commands.arguments.IntegerArgumentType.integer;
|
||||
import static net.minecraft.commands.builder.CommandBuilder.command;
|
||||
import static net.minecraft.commands.builder.RequiredArgumentBuilder.argument;
|
||||
|
||||
public class LiteralCommandNodeTest {
|
||||
LiteralCommandNode node;
|
||||
@@ -23,4 +25,16 @@ public class LiteralCommandNodeTest {
|
||||
public void testParseInvalid() throws Exception {
|
||||
node.parse("bar");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseChild() throws Exception {
|
||||
node.addChild(argument("bar", integer()).build());
|
||||
|
||||
node.parse("foo 123");
|
||||
}
|
||||
|
||||
@Test(expected = IllegalCommandArgumentException.class)
|
||||
public void testParseNoChildren() throws Exception {
|
||||
node.parse("foo 123");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user