diff options
| author | mat <github@matdoes.dev> | 2022-04-18 19:45:32 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-18 19:45:32 -0500 |
| commit | 78e692efc3fffc939f1b5af02e3cf32ca5302265 (patch) | |
| tree | 1f8de5d1b907f107f1cfbe571536723caf24e71b /azalea-brigadier/src/builder | |
| parent | b8ceb56e7141320d5ba23a946fe3eceee43f51f5 (diff) | |
| download | azalea-drasl-78e692efc3fffc939f1b5af02e3cf32ca5302265.tar.xz | |
move tests into tests directory
Diffstat (limited to 'azalea-brigadier/src/builder')
| -rw-r--r-- | azalea-brigadier/src/builder/argument_builder.rs | 79 |
1 files changed, 0 insertions, 79 deletions
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<S> Debug for ArgumentBuilder<S> { .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<Object> builder; - - // @Before - // public void setUp() throws Exception { - // builder = new TestableArgumentBuilder<>(); - // } - - // @Test - // public void testArguments() throws Exception { - // final RequiredArgumentBuilder<Object, ?> argument = argument("bar", integer()); - - // builder.then(argument); - - // assertThat(builder.getArguments(), hasSize(1)); - // assertThat(builder.getArguments(), hasItem((CommandNode<Object>) 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<Object> target = mock(CommandNode.class); - // builder.redirect(target); - // assertThat(builder.getRedirect(), is(target)); - // } - - // @Test(expected = IllegalStateException.class) - // public void testRedirect_withChild() throws Exception { - // final CommandNode<Object> target = mock(CommandNode.class); - // builder.then(literal("foo")); - // builder.redirect(target); - // } - - // @Test(expected = IllegalStateException.class) - // public void testThen_withRedirect() throws Exception { - // final CommandNode<Object> target = mock(CommandNode.class); - // builder.redirect(target); - // builder.then(literal("foo")); - // } - - // private static class TestableArgumentBuilder<S> extends ArgumentBuilder<S, TestableArgumentBuilder<S>> { - // @Override - // protected TestableArgumentBuilder<S> getThis() { - // return this; - // } - - // @Override - // public CommandNode<S> build() { - // return null; - // } - // } - // } -} |
