Commands can be parsed, in a very limited way.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package net.minecraft.commands.tree;
|
||||
|
||||
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.RequiredArgumentBuilder.argument;
|
||||
|
||||
public class ArgumentCommandNodeTest {
|
||||
ArgumentCommandNode node;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
node = argument("foo", integer()).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParse() throws Exception {
|
||||
node.parse("123");
|
||||
}
|
||||
|
||||
@Test(expected = IllegalCommandArgumentException.class)
|
||||
public void testParseInvalid() throws Exception {
|
||||
node.parse("bar");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user