-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1471] Add failing test reproducing the issue
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package picocli; | ||
|
||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
import picocli.CommandLine.Command; | ||
import picocli.CommandLine.Parameters; | ||
|
||
import static org.junit.Assert.*; | ||
import static picocli.CommandLine.ScopeType.INHERIT; | ||
|
||
public class Issue1471 { | ||
public CommandLine getTestCommandLine(ParentTestCommand parentCommand, TestCommand testCommand, CommandLine.IFactory factory) { | ||
CommandLine commandLine = new CommandLine(parentCommand, factory); | ||
commandLine.addSubcommand(testCommand); | ||
return commandLine; | ||
} | ||
@Command(name = "parentTestCommand", mixinStandardHelpOptions = true, scope = INHERIT) | ||
static class ParentTestCommand { | ||
} | ||
|
||
@Command(name = "sorteotest") | ||
static class TestCommand { | ||
@Command(name = "entertest", description = "Start participating in a giveaway") | ||
void enter(@Parameters(arity = "1") String sentenceType, | ||
@Parameters(arity = "1") String tweetUrl) { | ||
System.out.println("entering giveaway"); | ||
} | ||
} | ||
|
||
@Ignore | ||
@Test | ||
public void testIssue1741() { | ||
CommandLine commandLine = getTestCommandLine(new ParentTestCommand(), new TestCommand(), CommandLine.defaultFactory()); | ||
assertEquals(0, commandLine.execute("sorteotest", "entertest", "sequenceType", "url")); | ||
} | ||
|
||
} |