mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02:00
Complete enums on tab
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=192451820
This commit is contained in:
parent
8a9453f476
commit
bec24a3558
2 changed files with 112 additions and 42 deletions
|
@ -196,18 +196,18 @@ public class ShellCommandTest {
|
|||
"testCommand ",
|
||||
0,
|
||||
"",
|
||||
"Main parameter: normal argument\n (java.util.List<java.lang.String>)\n");
|
||||
performJCommanderCompletorTest("testAnotherCommand ", 0, "", "Main parameter: [None]\n");
|
||||
"Main parameter: normal argument\n (java.util.List<java.lang.String>)");
|
||||
performJCommanderCompletorTest("testAnotherCommand ", 0, "", "Main parameter: [None]");
|
||||
performJCommanderCompletorTest(
|
||||
"testCommand -x ", 0, "", "Flag documentation: test parameter\n (java.lang.String)\n");
|
||||
"testCommand -x ", 0, "", "Flag documentation: test parameter\n (java.lang.String)");
|
||||
performJCommanderCompletorTest(
|
||||
"testAnotherCommand -x ", 0, "", "Flag documentation: [No documentation available]\n");
|
||||
"testAnotherCommand -x ", 0, "", "Flag documentation: [No documentation available]");
|
||||
performJCommanderCompletorTest(
|
||||
"testCommand x ",
|
||||
0,
|
||||
"",
|
||||
"Main parameter: normal argument\n (java.util.List<java.lang.String>)\n");
|
||||
performJCommanderCompletorTest("testAnotherCommand x ", 0, "", "Main parameter: [None]\n");
|
||||
"Main parameter: normal argument\n (java.util.List<java.lang.String>)");
|
||||
performJCommanderCompletorTest("testAnotherCommand x ", 0, "", "Main parameter: [None]");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -218,8 +218,21 @@ public class ShellCommandTest {
|
|||
performJCommanderCompletorTest("testAnotherCommand --o", 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompletion_enum() throws Exception {
|
||||
performJCommanderCompletorTest("testCommand --xorg P", 1, "PRIVATE ", "PUBLIC ");
|
||||
performJCommanderCompletorTest("testCommand --xorg PU", 2, "PUBLIC ");
|
||||
performJCommanderCompletorTest(
|
||||
"testCommand --xorg ", 0, "", "Flag documentation: test organization\n (PRIVATE, PUBLIC)");
|
||||
}
|
||||
|
||||
@Parameters(commandDescription = "Test command")
|
||||
static class TestCommand implements Command {
|
||||
enum OrgType {
|
||||
PRIVATE,
|
||||
PUBLIC
|
||||
}
|
||||
|
||||
@Parameter(
|
||||
names = {"-x", "--xparam"},
|
||||
description = "test parameter"
|
||||
|
@ -230,7 +243,7 @@ public class ShellCommandTest {
|
|||
names = {"--xorg"},
|
||||
description = "test organization"
|
||||
)
|
||||
String xorg = "default value";
|
||||
OrgType orgType = OrgType.PRIVATE;
|
||||
|
||||
// List for recording command invocations by run().
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue