@Test public void testBuilderAddUnmatchedStack() { Stack<String> stack = new Stack<String>(); stack.push("a"); stack.push("b"); stack.push("c"); ParseResult.Builder builder = ParseResult.builder(CommandSpec.create()); builder.addUnmatched(stack); ParseResult parseResult = builder.build(); assertEquals(Arrays.asList("c", "b", "a"), parseResult.unmatched()); } }
@Test public void testBuilderAddUnmatched() { ParseResult.Builder builder = ParseResult.builder(CommandSpec.create()); builder.addUnmatched("abc"); ParseResult parseResult = builder.build(); assertEquals(Arrays.asList("abc"), parseResult.unmatched()); }
@Test public void testBuilderAddUnmatchedStack() { Stack<String> stack = new Stack<String>(); stack.push("a"); stack.push("b"); stack.push("c"); ParseResult.Builder builder = ParseResult.builder(CommandSpec.create()); builder.addUnmatched(stack); ParseResult parseResult = builder.build(); assertEquals(Arrays.asList("c", "b", "a"), parseResult.unmatched()); } }
private void clear() { position = 0; endOfOptions = false; isHelpRequested = false; parseResult = ParseResult.builder(getCommandSpec()); for (OptionSpec option : getCommandSpec().options()) { clear(option); } for (PositionalParamSpec positional : getCommandSpec().positionalParameters()) { clear(positional); } } private void clear(ArgSpec argSpec) {
@Test public void testBuilderAddUnmatched() { ParseResult.Builder builder = ParseResult.builder(CommandSpec.create()); builder.addUnmatched("abc"); ParseResult parseResult = builder.build(); assertEquals(Arrays.asList("abc"), parseResult.unmatched()); }
private void clear() { position = 0; endOfOptions = false; isHelpRequested = false; parseResult = ParseResult.builder(getCommandSpec()); for (OptionSpec option : getCommandSpec().options()) { clear(option); } for (PositionalParamSpec positional : getCommandSpec().positionalParameters()) { clear(positional); } } private void clear(ArgSpec argSpec) {