DebuggingUtils.java

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

Mutations

13

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

14

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

18

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

19

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

23

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

24

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

28

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

29

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

31

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

37

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

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

41

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

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

44

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

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

48

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

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

52

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

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

Active mutators

Tests examined


Report generated by PIT 1.7.3