Skip to content

Commit

Permalink
#571 add Interpreter.varargCanConsumeNextValue test
Browse files Browse the repository at this point in the history
  • Loading branch information
remkop committed Jan 1, 2019
1 parent 10830d9 commit 8fe03e7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/java/picocli/CommandLineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4007,4 +4007,13 @@ class App {
new CommandLine(new App()).parseArgs("-x");
assertTrue(systemErrRule.getLog().contains("App.x has 'help' annotation: not validating required fields"));
}

@Test
public void testVarargCanConsumeNextValue() {
class App {
@Parameters(arity = "*") List<String> all;
}
App app = CommandLine.populateCommand(new App(), "--", "a", "b");
assertEquals(Arrays.asList("a", "b"), app.all);
}
}

0 comments on commit 8fe03e7

Please sign in to comment.