DebuggingUtils.java

1
package com.github.valid8j.pcond.core;
2
3
import com.github.valid8j.pcond.validator.Validator;
4
import com.github.valid8j.pcond.internals.InternalUtils;
5
6
import java.io.PrintStream;
7
8
public enum DebuggingUtils {
9
  ;
10
11
  static <T, R> void printIo(String x, EvaluableIo<T, ? extends Evaluable<T>, R> io) {
12 1 1. printIo : negated conditional → SURVIVED
    if (isDebugLogEnabled())
13 1 1. printIo : removed call to java/io/PrintStream::println → NO_COVERAGE
      System.err.println(x + ":" + io.evaluableType() + ":" + io.evaluable() + "(" + io.input() + ")=" + io.output());
14
  }
15
16
  static <T> void printInput(String x, Evaluable<T> evaluable, ValueHolder<T> input) {
17 1 1. printInput : negated conditional → SURVIVED
    if (isDebugLogEnabled())
18 1 1. printInput : removed call to java/io/PrintStream::println → NO_COVERAGE
      System.err.println(x + ":" + evaluable + "(" + input + ")");
19
  }
20
21
  static <T, R> void printInputAndOutput(Evaluable<T> evaluable, ValueHolder<T> input, ValueHolder<R> output) {
22 1 1. printInputAndOutput : negated conditional → SURVIVED
    if (isDebugLogEnabled())
23 1 1. printInputAndOutput : removed call to java/io/PrintStream::println → NO_COVERAGE
      System.err.println("TRANSFORMATION:AFTER" + ":" + evaluable + "(" + input + ")=" + output);
24
  }
25
26
  static <T> void printTo(EvaluationContext<T> evaluationContext, PrintStream ps, int indent) {
27 1 1. printTo : negated conditional → SURVIVED
    if (isDebugLogEnabled()) {
28 1 1. printTo : removed call to java/io/PrintStream::println → NO_COVERAGE
      ps.println(InternalUtils.indent(indent) + "context=<" + evaluationContext + ">");
29
      for (Object each : evaluationContext.resultEntries()) {
30 2 1. printTo : Replaced integer addition with subtraction → NO_COVERAGE
2. printTo : removed call to java/io/PrintStream::println → NO_COVERAGE
        ps.println(InternalUtils.indent(indent + 1) + each);
31
      }
32
    }
33
  }
34
35
  public static boolean showEvaluableDetail() {
36 2 1. showEvaluableDetail : replaced boolean return with false for com/github/valid8j/pcond/core/DebuggingUtils::showEvaluableDetail → SURVIVED
2. showEvaluableDetail : replaced boolean return with true for com/github/valid8j/pcond/core/DebuggingUtils::showEvaluableDetail → KILLED
    return Validator.instance().configuration().debugging().map(Validator.Configuration.Debugging::showEvaluableDetail).orElse(false);
37
  }
38
39
  public static boolean suppressSquashing() {
40 2 1. suppressSquashing : replaced boolean return with false for com/github/valid8j/pcond/core/DebuggingUtils::suppressSquashing → SURVIVED
2. suppressSquashing : replaced boolean return with true for com/github/valid8j/pcond/core/DebuggingUtils::suppressSquashing → KILLED
    return Validator.instance().configuration().debugging().map(Validator.Configuration.Debugging::suppressSquashing).orElse(false);
41
  }
42
  public static boolean isDebugLogEnabled() {
43 2 1. isDebugLogEnabled : replaced boolean return with false for com/github/valid8j/pcond/core/DebuggingUtils::isDebugLogEnabled → SURVIVED
2. isDebugLogEnabled : replaced boolean return with true for com/github/valid8j/pcond/core/DebuggingUtils::isDebugLogEnabled → SURVIVED
    return Validator.instance().configuration().debugging().map(Validator.Configuration.Debugging::enableDebugLog).orElse(false);
44
  }
45
46
  public static boolean reportIgnoredEntries() {
47 2 1. reportIgnoredEntries : replaced boolean return with false for com/github/valid8j/pcond/core/DebuggingUtils::reportIgnoredEntries → SURVIVED
2. reportIgnoredEntries : replaced boolean return with true for com/github/valid8j/pcond/core/DebuggingUtils::reportIgnoredEntries → KILLED
    return Validator.instance().configuration().debugging().map(Validator.Configuration.Debugging::reportIgnoredEntries).orElse(false);
48
  }
49
50
  public static boolean passThroughComparisonFailure() {
51 2 1. passThroughComparisonFailure : replaced boolean return with false for com/github/valid8j/pcond/core/DebuggingUtils::passThroughComparisonFailure → SURVIVED
2. passThroughComparisonFailure : replaced boolean return with true for com/github/valid8j/pcond/core/DebuggingUtils::passThroughComparisonFailure → KILLED
    return Validator.instance().configuration().debugging().map(Validator.Configuration.Debugging::passThroughComparisonFailure).orElse(false);
52
  }
53
}

Mutations

12

1.1
Location : printIo
Killed by : none
negated conditional → SURVIVED

13

1.1
Location : printIo
Killed by : none
removed call to java/io/PrintStream::println → NO_COVERAGE

17

1.1
Location : printInput
Killed by : none
negated conditional → SURVIVED

18

1.1
Location : printInput
Killed by : none
removed call to java/io/PrintStream::println → NO_COVERAGE

22

1.1
Location : printInputAndOutput
Killed by : none
negated conditional → SURVIVED

23

1.1
Location : printInputAndOutput
Killed by : none
removed call to java/io/PrintStream::println → NO_COVERAGE

27

1.1
Location : printTo
Killed by : none
negated conditional → SURVIVED

28

1.1
Location : printTo
Killed by : none
removed call to java/io/PrintStream::println → NO_COVERAGE

30

1.1
Location : printTo
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : printTo
Killed by : none
removed call to java/io/PrintStream::println → NO_COVERAGE

36

1.1
Location : showEvaluableDetail
Killed by : none
replaced boolean return with false for com/github/valid8j/pcond/core/DebuggingUtils::showEvaluableDetail → SURVIVED

2.2
Location : showEvaluableDetail
Killed by : com.github.valid8j.ut.utilstest.PredicatesTest$MessageTest.testFormat(com.github.valid8j.ut.utilstest.PredicatesTest$MessageTest)
replaced boolean return with true for com/github/valid8j/pcond/core/DebuggingUtils::showEvaluableDetail → KILLED

40

1.1
Location : suppressSquashing
Killed by : none
replaced boolean return with false for com/github/valid8j/pcond/core/DebuggingUtils::suppressSquashing → SURVIVED

2.2
Location : suppressSquashing
Killed by : com.github.valid8j.ut.internal.NegateTest.whenInvertedTrasformingPredicateFails_thenPrintDesignedMessage$notMergedWhenMismatch(com.github.valid8j.ut.internal.NegateTest)
replaced boolean return with true for com/github/valid8j/pcond/core/DebuggingUtils::suppressSquashing → KILLED

43

1.1
Location : isDebugLogEnabled
Killed by : none
replaced boolean return with false for com/github/valid8j/pcond/core/DebuggingUtils::isDebugLogEnabled → SURVIVED

2.2
Location : isDebugLogEnabled
Killed by : none
replaced boolean return with true for com/github/valid8j/pcond/core/DebuggingUtils::isDebugLogEnabled → SURVIVED

47

1.1
Location : reportIgnoredEntries
Killed by : none
replaced boolean return with false for com/github/valid8j/pcond/core/DebuggingUtils::reportIgnoredEntries → SURVIVED

2.2
Location : reportIgnoredEntries
Killed by : com.github.valid8j.ut.experimentals.DbCCurriedFunctionsTest.givenString$hello$_whenTransformToContextAndCheckContextValueIsNull_thenPreconditionViolationWithCorrectMessageThrown(com.github.valid8j.ut.experimentals.DbCCurriedFunctionsTest)
replaced boolean return with true for com/github/valid8j/pcond/core/DebuggingUtils::reportIgnoredEntries → KILLED

51

1.1
Location : passThroughComparisonFailure
Killed by : none
replaced boolean return with false for com/github/valid8j/pcond/core/DebuggingUtils::passThroughComparisonFailure → SURVIVED

2.2
Location : passThroughComparisonFailure
Killed by : com.github.valid8j.ut.styles.fluent.FluentBooleanTest.givenFalse_whenIsTrue_thenComparisonFailure(com.github.valid8j.ut.styles.fluent.FluentBooleanTest)
replaced boolean return with true for com/github/valid8j/pcond/core/DebuggingUtils::passThroughComparisonFailure → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3