blob: 6dc9972028e19c0379dc4fef2ebce01facc607b8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package joptsimple.examples;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
import org.junit.Test;
import static java.util.Arrays.*;
import static org.junit.Assert.*;
public class UnrecognizedOptionsAllowedTest {
@Test
public void acceptsLongOptions() {
OptionParser parser = new OptionParser();
parser.allowsUnrecognizedOptions();
parser.accepts( "f" );
OptionSet options = parser.parse( "-f", "-d" );
assertTrue( options.has( "f" ) );
assertFalse( options.has( "d" ) );
assertEquals( asList( "-d" ), options.nonOptionArguments() );
}
}
|