From 78e692efc3fffc939f1b5af02e3cf32ca5302265 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 18 Apr 2022 19:45:32 -0500 Subject: move tests into tests directory --- azalea-brigadier/src/builder/argument_builder.rs | 79 ------------------------ 1 file changed, 79 deletions(-) (limited to 'azalea-brigadier/src/builder') diff --git a/azalea-brigadier/src/builder/argument_builder.rs b/azalea-brigadier/src/builder/argument_builder.rs index 14d41f4e..d26b2a8a 100644 --- a/azalea-brigadier/src/builder/argument_builder.rs +++ b/azalea-brigadier/src/builder/argument_builder.rs @@ -135,82 +135,3 @@ impl Debug for ArgumentBuilder { .finish() } } - -#[cfg(test)] -mod tests { - use std::rc::Rc; - - use crate::{ - arguments::integer_argument_type::integer, - builder::{literal_argument_builder::literal, required_argument_builder::argument}, - }; - - use super::ArgumentBuilder; - - // public class ArgumentBuilderTest { - // private TestableArgumentBuilder builder; - - // @Before - // public void setUp() throws Exception { - // builder = new TestableArgumentBuilder<>(); - // } - - // @Test - // public void testArguments() throws Exception { - // final RequiredArgumentBuilder argument = argument("bar", integer()); - - // builder.then(argument); - - // assertThat(builder.getArguments(), hasSize(1)); - // assertThat(builder.getArguments(), hasItem((CommandNode) argument.build())); - // } - - #[test] - fn test_arguments() { - let mut builder: ArgumentBuilder<()> = literal("foo"); - - let argument: ArgumentBuilder<()> = argument("bar", integer()); - builder.then(argument.clone()); - assert_eq!(builder.arguments.children.len(), 1); - let built_argument = Rc::new(argument.build()); - assert!(builder - .arguments - .children - .values() - .any(|e| *e.borrow() == *built_argument)); - } - - // @Test - // public void testRedirect() throws Exception { - // final CommandNode target = mock(CommandNode.class); - // builder.redirect(target); - // assertThat(builder.getRedirect(), is(target)); - // } - - // @Test(expected = IllegalStateException.class) - // public void testRedirect_withChild() throws Exception { - // final CommandNode target = mock(CommandNode.class); - // builder.then(literal("foo")); - // builder.redirect(target); - // } - - // @Test(expected = IllegalStateException.class) - // public void testThen_withRedirect() throws Exception { - // final CommandNode target = mock(CommandNode.class); - // builder.redirect(target); - // builder.then(literal("foo")); - // } - - // private static class TestableArgumentBuilder extends ArgumentBuilder> { - // @Override - // protected TestableArgumentBuilder getThis() { - // return this; - // } - - // @Override - // public CommandNode build() { - // return null; - // } - // } - // } -} -- cgit v1.2.3