From: Otmar H. <otm...@us...> - 2006-03-26 19:55:15
|
Update of /cvsroot/jython/installer/test/java/org/apache/commons/cli In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32276/test/java/org/apache/commons/cli Modified Files: PosixParserTest.java Log Message: added a test case for the misspelled long option problem Index: PosixParserTest.java =================================================================== RCS file: /cvsroot/jython/installer/test/java/org/apache/commons/cli/PosixParserTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PosixParserTest.java 18 Feb 2006 22:30:22 -0000 1.1 --- PosixParserTest.java 26 Mar 2006 19:55:09 -0000 1.2 *************** *** 107,110 **** --- 107,125 ---- } + /** + * test that a misspelled long option (-test instead of --test) is not interpreted as -t est + */ + public void testMisspelledLongOption() { + boolean stopAtNonOption = false; // means every token should be added + String[] args; + String[] expectedFlattened; + + // unknown single dash long option + String singleDashLongOption = "-" + TEST_LONG; + args = new String[] { singleDashLongOption }; + expectedFlattened = new String[] { singleDashLongOption }; + assertEquals(expectedFlattened, _parser.flatten(_options, args, stopAtNonOption)); + } + // // private stuff |