Skip to content

Commit

Permalink
Merge pull request #1188 from hcoles/feature/multi_mutators
Browse files Browse the repository at this point in the history
allow multiple mutations per mutator
  • Loading branch information
hcoles authored Apr 13, 2023
2 parents 2a2b827 + 7be0cb7 commit 7d5e20a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
public class DefaultTestPrioritiser implements TestPrioritiser {

private static final int TIME_WEIGHTING_FOR_DIRECT_UNIT_TESTS = 1000;
private static final int TIME_WEIGHTING_FOR_DIRECT_UNIT_TESTS = 1000;

private final CoverageDatabase coverage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public Mutant getMutation(final MutationIdentifier id) {
this.computeCache, FrameOptions.pickFlags(bytes.get()));
final MutatingClassVisitor mca = new MutatingClassVisitor(w, context,
filterMethods(), FCollection.filter(this.mutators,
isMutatorFor(id)));
m -> m.isMutatorFor(id)));
reader.accept(mca, ClassReader.EXPAND_FRAMES);

final List<MutationDetails> details = context.getMutationDetails(context
Expand All @@ -112,11 +112,6 @@ public Mutant getMutation(final MutationIdentifier id) {

}

private static Predicate<MethodMutatorFactory> isMutatorFor(
final MutationIdentifier id) {
return a -> id.getMutator().equals(a.getGloballyUniqueId());
}

private Predicate<MethodInfo> filterMethods() {
return and(this.filter, filterSyntheticMethods());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.pitest.mutationtest.engine.gregor;

import org.objectweb.asm.MethodVisitor;
import org.pitest.mutationtest.engine.MutationIdentifier;
import org.pitest.plugin.ClientClasspathPlugin;

/**
Expand Down Expand Up @@ -61,4 +62,8 @@ default String description() {
return getName();
}

default boolean isMutatorFor(MutationIdentifier id) {
return id.getMutator().equals(getGloballyUniqueId());
}

}

0 comments on commit 7d5e20a

Please sign in to comment.