Skip to content

Commit

Permalink
[#1537] update test setAbbreviatedOptionsAllowed (still cannot reprod…
Browse files Browse the repository at this point in the history
…uce)
  • Loading branch information
remkop committed Jan 2, 2022
1 parent 6dd427c commit a1bd031
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/java/picocli/Issue1537Ambiguous.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public class Issue1537Ambiguous {
@Command
static class MyCommand implements Runnable {

@Command(name = "chemical-files", aliases = "chem-formats")
@Command(name = "chemical-files", aliases = {"chem-formats"})
void sub() {}

public void run() {}
}

@Test
public void testExecute() {
int exitCode = new CommandLine(new MyCommand()).execute("chem");
int exitCode = new CommandLine(new MyCommand()).setAbbreviatedOptionsAllowed(true).execute("chem");
assertEquals(2, exitCode);

String expected = String.format(
Expand All @@ -35,7 +35,7 @@ public void testExecute() {
@Test
public void testParseArgs() {
try {
new CommandLine(new MyCommand()).parseArgs("chem");
new CommandLine(new MyCommand()).setAbbreviatedOptionsAllowed(true).parseArgs("chem");
fail("expected exception");
} catch (CommandLine.UnmatchedArgumentException ex) {
assertEquals("Unmatched argument at index 0: 'chem'", ex.getMessage());
Expand Down

0 comments on commit a1bd031

Please sign in to comment.