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 |
|
14 |
1.1 |
|
18 |
1.1 |
|
19 |
1.1 |
|
23 |
1.1 |
|
24 |
1.1 |
|
28 |
1.1 |
|
29 |
1.1 |
|
31 |
1.1 2.2 |
|
37 |
1.1 2.2 |
|
41 |
1.1 2.2 |
|
44 |
1.1 2.2 |
|
48 |
1.1 2.2 |
|
52 |
1.1 2.2 |