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 |
|
13 |
1.1 |
|
17 |
1.1 |
|
18 |
1.1 |
|
22 |
1.1 |
|
23 |
1.1 |
|
27 |
1.1 |
|
28 |
1.1 |
|
30 |
1.1 2.2 |
|
36 |
1.1 2.2 |
|
40 |
1.1 2.2 |
|
43 |
1.1 2.2 |
|
47 |
1.1 2.2 |
|
51 |
1.1 2.2 |