garydgregory commented on code in PR #396: URL: https://github.com/apache/commons-cli/pull/396#discussion_r2360682286
########## pom.xml: ########## @@ -24,7 +24,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>commons-cli</groupId> <artifactId>commons-cli</artifactId> - <version>1.10.1-SNAPSHOT</version> + <version>1.11.0-SNAPSHOT</version> Review Comment: Don't change this unless you change the version everywhere, which is best left for a maintainer in this case, post merge. ########## src/test/java/org/apache/commons/cli/OptionCountTest.java: ########## @@ -0,0 +1,61 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +package org.apache.commons.cli; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class OptionCountTest { + final char verbosityChar = 'v'; + final String verbosityStr = String.valueOf(verbosityChar); + final Option verbosity = new Option(verbosityStr, "verbosity: use multiple times for more"); + final Options options = new Options().addOption(verbosity); + + @Test + void noSwitchTest() throws ParseException { + final CommandLine cmdLine = new DefaultParser().parse(options, new String[]{}); + assertEquals(0, cmdLine.getOptionCount(verbosity)); + } + + @Test + void oneSwitchTest() throws ParseException { Review Comment: Use "test" aa the prefix for test method names, not as a suffix. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org