1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.cli.bug;
19
20 import static org.junit.jupiter.api.Assertions.assertFalse;
21
22 import org.apache.commons.cli.CommandLine;
23 import org.apache.commons.cli.Option;
24 import org.apache.commons.cli.Options;
25 import org.apache.commons.cli.ParseException;
26 import org.apache.commons.cli.PosixParser;
27 import org.junit.jupiter.api.Test;
28
29 @SuppressWarnings("deprecation")
30 public class BugCLI133Test {
31 @Test
32 public void testOrder() throws ParseException {
33 final Option optionA = new Option("a", "first");
34 final Options opts = new Options();
35 opts.addOption(optionA);
36 final PosixParser posixParser = new PosixParser();
37 final CommandLine line = posixParser.parse(opts, null);
38 assertFalse(line.hasOption((String) null));
39 }
40 }