assertEquals(list(list("1", "2")), res.get("buzz"));
}
@Test
public void testParseArgsWithPosargNargsEmptyList() throws ArgumentParserException {
Namespace res;
ap.addArgument("foo").nargs("*");
res = ap.parseArgs(zeroargs);
assertEquals(list(), res.get("foo"));
ap = new ArgumentParserImpl("argparse4j");
ap.addArgument("foo").nargs("*").setDefault("foo");
// Make sure that default value is kept
res = ap.parseArgs(zeroargs);
assertEquals("foo", res.get("foo"));
// Make sure that given argument list overwrites default.
res = ap.parseArgs("a b".split(" "));
assertEquals(list("a", "b"), res.get("foo"));
ap = new ArgumentParserImpl("argparse4j");
ap.addArgument("foo").nargs("*").action(append());
// Make sure that empty list is returned.
res = ap.parseArgs(zeroargs);
assertEquals(list(), res.get("foo"));
ap = new ArgumentParserImpl("argparse4j");
ap.addArgument("foo").nargs("*").action(append()).setDefault("foo");
// Make sure that default stays intact without positional argument
res = ap.parseArgs(zeroargs);
assertEquals("foo", res.get("foo"));
// Make sure that given argument list overwrites default.
res = ap.parseArgs("a b".split(" "));
assertEquals(list(list("a", "b")), res.get("foo"));
}