Implemented merging of CommandNode children

This commit is contained in:
Nathan Adams
2014-09-25 17:21:26 +02:00
parent d8c9e15a1c
commit 82b576e38c
9 changed files with 166 additions and 31 deletions
@@ -9,9 +9,14 @@ import static net.minecraft.commands.builder.LiteralArgumentBuilder.literal;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
public class RootCommandNodeTest {
public class RootCommandNodeTest extends AbstractCommandNodeTest {
RootCommandNode node;
@Override
protected CommandNode getCommandNode() {
return node;
}
@Before
public void setUp() throws Exception {
node = new RootCommandNode();
@@ -22,6 +27,11 @@ public class RootCommandNodeTest {
assertThat(node.parse("foo bar baz", new CommandContextBuilder()), is("foo bar baz"));
}
@Test(expected = UnsupportedOperationException.class)
public void testAddChildNoRoot() throws Exception {
node.addChild(new RootCommandNode());
}
@Test
public void testEquals() throws Exception {
new EqualsTester()