Skip to content

Commit

Permalink
[remkop#1319] add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
remkop authored and MarkoMackic committed Oct 17, 2021
1 parent 735f951 commit 88cfd06
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/java/picocli/InheritedOptionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -557,4 +557,24 @@ class Example { }
// see also picocli-annotation-processing-tests/src/test/java/picocli/annotation/processing/tests/Issue1316Test.java
new CommandLine(new Example()); // succeeds without error
}

@Ignore("Needs fix for #1319")
@Test
public void testIssue1319() {
@Command(scope = CommandLine.ScopeType.INHERIT
, mixinStandardHelpOptions = true
, subcommands = { CommandLine.HelpCommand.class }
)
class InheritHelpApp {
int subFoo;

@Command()
void sub(@Option(names = "-foo") int foo) {
subFoo = foo;
}
}
InheritHelpApp app = new InheritHelpApp();
new CommandLine(app).execute("sub", "-foo", "42" );
assertEquals(42, app.subFoo);
}
}

0 comments on commit 88cfd06

Please sign in to comment.