-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1301 from CodeGra-de/bugfix/allow-passing-multipl…
…e-advanced-args Allow passing multiple options in the "Advanced" group
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package de.jplag.cli; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import java.util.Arrays; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class AdvancedGroupTest extends CommandLineInterfaceTest { | ||
private static final String SUFFIXES = ".sc,.scala"; | ||
|
||
private static final double SIMILARITY_THRESHOLD = 0.5; | ||
|
||
/** | ||
* Verify that it is possible to set multiple options in the "advanced" options group. | ||
*/ | ||
@Test | ||
void testNotExclusive() throws CliException { | ||
buildOptionsFromCLI(defaultArguments().suffixes(SUFFIXES).similarityThreshold(SIMILARITY_THRESHOLD)); | ||
assertEquals(Arrays.stream(SUFFIXES.split(",")).toList(), options.fileSuffixes()); | ||
assertEquals(0.5, options.similarityThreshold()); | ||
} | ||
} |