Skip to content

Commit fc2253e

Browse files
author
John Keyes
committed
tided the unit test for 14786
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/cli/trunk@129872 13f79535-47bb-0310-9956-ffa450edef68
1 parent 500e99f commit fc2253e

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/test/org/apache/commons/cli/BugsTest.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* version 1.1, a copy of which has been included with this distribution in
66
* the LICENSE file.
77
*
8-
* $Id: BugsTest.java,v 1.13 2003/01/13 08:17:26 jkeyes Exp $
8+
* $Id: BugsTest.java,v 1.14 2003/01/16 21:37:10 jkeyes Exp $
99
*/
1010

1111
package org.apache.commons.cli;
@@ -344,7 +344,7 @@ public void test13935() {
344344
}
345345
}
346346

347-
public void test14786() {
347+
public void test14786() throws Exception {
348348
Option o = OptionBuilder.isRequired().withDescription("test").create("test");
349349
Options opts = new Options();
350350
opts.addOption(o);
@@ -353,12 +353,9 @@ public void test14786() {
353353
CommandLineParser parser = new GnuParser();
354354

355355
String[] args = new String[] { "-test" };
356-
try {
357-
CommandLine line = parser.parse( opts, args );
358-
}
359-
catch( ParseException exp ) {
360-
fail( "Unexpected exception:" + exp.getMessage() );
361-
}
356+
357+
CommandLine line = parser.parse( opts, args );
358+
assertTrue( line.hasOption( "test" ) );
362359
}
363360

364361
public void test15046() throws Exception {

0 commit comments

Comments
 (0)