From bf94ceab94cf303f4ce5210dbb4fa04d7d1a46d3 Mon Sep 17 00:00:00 2001 From: Remko Popma Date: Sun, 7 Nov 2021 13:08:01 +0900 Subject: [PATCH] [#1384] add failing test --- src/test/java/picocli/ArgGroupTest.java | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/test/java/picocli/ArgGroupTest.java b/src/test/java/picocli/ArgGroupTest.java index 23cdd0604..da2fb443a 100644 --- a/src/test/java/picocli/ArgGroupTest.java +++ b/src/test/java/picocli/ArgGroupTest.java @@ -4045,4 +4045,29 @@ public void testIssue1300BooleanInitialization() { System.setErr(err); assertEquals("", baos.toString()); } + + @Ignore + @Command(name = "CLI Test 2", mixinStandardHelpOptions = true) + static class Issue1384 { + static class MyArgGroup { + @Parameters(index = "0", arity = "1", description = "parameter 0") + String param0; + @Parameters(index = "1", arity = "0..1", description = "parameter 1") + String param1; + @Parameters(index = "2", arity = "0..1", description = "parameter 2") + String param2; + } + + @ArgGroup(order = 0, exclusive = false, multiplicity = "1") + MyArgGroup argGroup; + } + + @Test + public void testIssue1384() { + Issue1384 obj = new Issue1384(); + new CommandLine(obj).parseArgs("1", "a", "b"); + assertEquals(obj.argGroup.param0, "1"); + assertEquals(obj.argGroup.param1, "a"); + assertEquals(obj.argGroup.param2, "b"); + } }