-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support simple mutator exclusion for #954
- Loading branch information
Henry Coles
committed
Nov 1, 2021
1 parent
dc0adab
commit e617c1f
Showing
6 changed files
with
79 additions
and
4 deletions.
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
1 change: 0 additions & 1 deletion
1
pitest-entry/src/test/java/org/pitest/mutationtest/build/MutationDiscoveryTest.java
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
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
48 changes: 48 additions & 0 deletions
48
...t/src/test/java/org/pitest/mutationtest/engine/gregor/config/GregorEngineFactoryTest.java
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,48 @@ | ||
package org.pitest.mutationtest.engine.gregor.config; | ||
|
||
import org.junit.Test; | ||
import org.pitest.mutationtest.EngineArguments; | ||
import org.pitest.mutationtest.engine.MutationEngine; | ||
|
||
import java.util.List; | ||
|
||
import static java.util.Arrays.asList; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class GregorEngineFactoryTest { | ||
|
||
GregorEngineFactory underTest = new GregorEngineFactory(); | ||
|
||
@Test | ||
public void parsesSingleMutatorString() { | ||
MutationEngine actual = parseMutators(asList("NULL_RETURNS")); | ||
|
||
assertThat(actual.getMutatorNames()).contains("NULL_RETURNS"); | ||
} | ||
|
||
@Test | ||
public void parsesGroups() { | ||
MutationEngine actual = parseMutators(asList("STRONGER")); | ||
|
||
assertThat(actual.getMutatorNames()).contains("NULL_RETURNS", "REMOVE_CONDITIONALS_EQUAL_ELSE"); | ||
} | ||
|
||
@Test | ||
public void parsesExclusions() { | ||
MutationEngine excluded = parseMutators(asList("STRONGER", "-REMOVE_CONDITIONALS_EQUAL_ELSE")); | ||
|
||
assertThat(excluded.getMutatorNames()).doesNotContain("REMOVE_CONDITIONALS_EQUAL_ELSE"); | ||
assertThat(excluded.getMutatorNames()).isNotEmpty(); | ||
} | ||
|
||
@Test | ||
public void excludesGroups() { | ||
MutationEngine excluded = parseMutators(asList("ALL", "-ALL")); | ||
assertThat(excluded.getMutatorNames()).isEmpty(); | ||
} | ||
|
||
private MutationEngine parseMutators(List<String> mutators) { | ||
return underTest.createEngine(EngineArguments.arguments().withMutators(mutators)); | ||
} | ||
|
||
} |
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