aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/java/jopt-simple/src/test/java/joptsimple/examples/ShortOptionsClusteringWithArgumentTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/java/jopt-simple/src/test/java/joptsimple/examples/ShortOptionsClusteringWithArgumentTest.java')
-rw-r--r--third_party/java/jopt-simple/src/test/java/joptsimple/examples/ShortOptionsClusteringWithArgumentTest.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/third_party/java/jopt-simple/src/test/java/joptsimple/examples/ShortOptionsClusteringWithArgumentTest.java b/third_party/java/jopt-simple/src/test/java/joptsimple/examples/ShortOptionsClusteringWithArgumentTest.java
new file mode 100644
index 0000000000..695f6cebbc
--- /dev/null
+++ b/third_party/java/jopt-simple/src/test/java/joptsimple/examples/ShortOptionsClusteringWithArgumentTest.java
@@ -0,0 +1,24 @@
+package joptsimple.examples;
+
+import joptsimple.OptionParser;
+import joptsimple.OptionSet;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+public class ShortOptionsClusteringWithArgumentTest {
+ @Test
+ public void allowsClusteringShortOptionsThatAcceptArguments() {
+ OptionParser parser = new OptionParser();
+ parser.accepts( "a" );
+ parser.accepts( "B" );
+ parser.accepts( "c" ).withRequiredArg();
+
+ OptionSet options = parser.parse( "-aBcfoo" );
+
+ assertTrue( options.has( "a" ) );
+ assertTrue( options.has( "B" ) );
+ assertTrue( options.has( "c" ) );
+ assertEquals( "foo", options.valueOf( "c" ) );
+ }
+}