You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, we are having problems with the BooleanTrueReturnValsMutator.
We have a code like:
data.stream()
.map(
x -> {
try {
operation.accept(x);
returntrue; // Mutated with BooleanTrueReturnValsMutator and BooleanFalseReturnValsMutator
} catch (RuntimeExceptione) {
returnfalse; // Mutated only with BooleanTrueReturnValsMutator
}
})
.reduce(true, Boolean::logicalAnd);
Because the method return true is mutated with a return true the mutation survives all test.
We only experienced this problem with lambdas with try/catch
Tested with gradle plugin 1.7.0, pitest 1.70 and 1.7.4, junit 5.8.2 with 0.15 junit plugin using JDK 8, 11 and 17.
I couldn't figure out if there are something wrong in our setup.
See the POC project.
The text was updated successfully, but these errors were encountered:
Thanks @kiov, I'll take a proper look in a moment, but at a first glance this looks like a bug. Equivalent mutants like this should be filtered out. I'm guessing the try catch block is tripping up pitest's analysis.
The POC project will be a big help - thanks for that.
Hi, we are having problems with the BooleanTrueReturnValsMutator.
We have a code like:
Because the method
return true
is mutated with a return true the mutation survives all test.We only experienced this problem with lambdas with try/catch
Tested with gradle plugin 1.7.0, pitest 1.70 and 1.7.4, junit 5.8.2 with 0.15 junit plugin using JDK 8, 11 and 17.
I couldn't figure out if there are something wrong in our setup.
See the POC project.
The text was updated successfully, but these errors were encountered: