1 | assertEquals(FILE_OPT, ((CLOption) clOptions.get(2)).getDescriptor().getId());↵ | | 1 | assertEquals(FILE_OPT, ((CLOption) clOptions.get(0)).getDescriptor().getId());↵
|
2 | assertEquals("a", ((CLOption) clOptions.get(2)).getArgument());↵ | | 2 | assertEquals("-=-", ((CLOption) clOptions.get(0)).getArgument());↵
|
3 | }↵ | | 3 | }↵
|
|
4 | public void testCombinedArgs3() {↵ | | 4 | public void testCombinedArgs1() {↵
|
5 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] { BLEE, TAINT, FILE };↵ | | 5 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] { BLEE, TAINT };↵
|
|
6 | final CLArgsParser parser = new CLArgsParser(new String[] { "-bT", "--", "-fa" }// Should↵ | | 6 | final CLArgsParser parser = new CLArgsParser(new String[] { "-bT", "↵
|
7 | // not↵ | | |
|
8 | // detect↵ | | |
|
9 | // trailing↵ | | |
|
10 | // option↵ | | |
|
11 | , options);↵ | | 7 | rest" }, options);↵
|
|
12 | assertNull(parser.getErrorString(), parser.getErrorString());↵ | | 8 | assertNull(parser.getErrorString(), parser.getErrorString());↵
|
|
13 | final List clOptions = parser.getArguments();↵ | | 9 | final List clOptions = parser.getArguments();↵
|
14 | final int size = clOptions.size();↵ | | 10 | final int size = clOptions.size();↵
|
15 | assertEquals(3, size);↵ | | 11 | assertEquals(3, size);↵
|
16 | assertEquals(BLEE_OPT, ((CLOption) clOptions.get(0)).getDescriptor().getId());↵ | | 12 | assertEquals(BLEE_OPT, ((CLOption) clOptions.get(0)).getDescriptor().getId());↵
|
17 | assertEquals(TAINT_OPT, ((CLOption) clOptions.get(1)).getDescriptor().getId());↵ | | 13 | assertEquals(TAINT_OPT, ((CLOption) clOptions.get(1)).getDescriptor().getId());↵
|
18 | assertEquals(0, ((CLOption) clOptions.get(2)).getDescriptor().getId());↵ | | 14 | assertEquals(0, ((CLOption) clOptions.get(2)).getDescriptor().getId());↵
|
19 | assertEquals("-fa", ((CLOption) clOptions.get(2)).getArgument());↵ | | 15 | assertEquals("rest", ((CLOption) clOptions.get(2)).getArgument());↵
|
20 | }↵ | | 16 | }↵
|
|
21 | public void testCombinedArgs4() {↵ | | 17 | public void testCombinedArgs2() {↵
|
22 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] { BLEE, TAINT, FILE };↵ | | 18 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] { BLEE, TAINT, FILE };↵
|
|
23 | final CLArgsParser parser = new CLArgsParser(new String[] { "-bT", "rest", "-fa" } // should↵ | | 19 | final CLArgsParser parser = new CLArgsParser(new String[] { "-bT", "↵
|
24 | // detect↵ | | |
|
25 | // trailing↵ | | |
|
26 | // option↵ | | |
|
27 | , options);↵ | | 20 | -fa" }, options);↵
|
|
28 | assertNull(parser.getErrorString(), parser.getErrorString());↵ | | 21 | assertNull(parser.getErrorString(), parser.getErrorString());↵
|
|
29 | final List clOptions = parser.getArguments();↵ | | 22 | final List clOptions = parser.getArguments();↵
|
30 | final int size = clOptions.size();↵ | | 23 | final int size = clOptions.size();↵
|
31 | assertEquals(4, size);↵ | | 24 | assertEquals(3, size);↵
|
32 | assertEquals(BLEE_OPT, ((CLOption) clOptions.get(0)).getDescriptor().getId());↵ | | 25 | assertEquals(BLEE_OPT, ((CLOption) clOptions.get(0)).getDescriptor().getId());↵
|
33 | assertEquals(TAINT_OPT, ((CLOption) clOptions.get(1)).getDescriptor().getId());↵ | | 26 | assertEquals(TAINT_OPT, ((CLOption) clOptions.get(1)).getDescriptor().getId());↵
|
34 | assertEquals | | 27 | assertEquals
|