diff --git a/pitest-command-line/src/main/java/org/pitest/mutationtest/commandline/MutationCoverageReport.java b/pitest-command-line/src/main/java/org/pitest/mutationtest/commandline/MutationCoverageReport.java index ce08a44a8..6a857ca30 100644 --- a/pitest-command-line/src/main/java/org/pitest/mutationtest/commandline/MutationCoverageReport.java +++ b/pitest-command-line/src/main/java/org/pitest/mutationtest/commandline/MutationCoverageReport.java @@ -50,7 +50,7 @@ public static void main(final String[] args) { data.getTestStrengthThreshold()); throwErrorIfScoreBelowMutationThreshold(stats.getMutationStatistics(), data.getMutationThreshold()); - throwErrorIfMoreThanMaxSuvivingMutants(stats.getMutationStatistics(), data.getMaximumAllowedSurvivors()); + throwErrorIfMoreThanMaxSurvivingMutants(stats.getMutationStatistics(), data.getMaximumAllowedSurvivors()); } } @@ -81,9 +81,9 @@ private static void throwErrorIfScoreBelowTestStrengthThreshold( } } - private static void throwErrorIfMoreThanMaxSuvivingMutants( + private static void throwErrorIfMoreThanMaxSurvivingMutants( final MutationStatistics stats, final long threshold) { - if ((threshold > 0) + if ((threshold >= 0) && (stats.getTotalSurvivingMutations() > threshold)) { throw new RuntimeException("Had " + stats.getTotalSurvivingMutations() + " surviving mutants, but only "