ParameterizedFunctionFactory.java

1
package com.github.dakusui.pcond.core.printable;
2
3
import com.github.dakusui.pcond.forms.Printables;
4
5
import java.util.List;
6
import java.util.function.Function;
7
import java.util.function.Supplier;
8
9
import static java.util.Arrays.asList;
10
11
public interface ParameterizedFunctionFactory<T, R> extends ParameterizedIdentifiableFactory<Function<T, R>> {
12
  class Builder<T, R> extends ParameterizedIdentifiableFactory.Builder<Function<T, R>, Builder<T, R>> {
13
    public ParameterizedFunctionFactory<T, R> buildProtected() {
14 1 1. buildProtected : replaced return value with null for com/github/dakusui/pcond/core/printable/ParameterizedFunctionFactory$Builder::buildProtected → KILLED
      return new ParameterizedFunctionFactory<T, R>() {
15
        final Function<List<Object>, Supplier<String>> formatterFactory = Builder.this.formatterFactory;
16
        @Override
17
        public Function<T, R> create(Object... args) {
18
          List<Object> args_ = asList(args);
19 1 1. create : replaced return value with null for com/github/dakusui/pcond/core/printable/ParameterizedFunctionFactory$Builder$1::create → KILLED
          return Printables.function(
20
              formatterFactory.apply(args_),
21
              this.toPrintableFunction(args_));
22
        }
23
24
        public Function<T, R> toPrintableFunction(List<Object> args) {
25
          Function<T, R> function = factory.apply(args);
26 1 1. toPrintableFunction : negated conditional → SURVIVED
          if (function instanceof PrintableFunction)
27 1 1. toPrintableFunction : replaced return value with null for com/github/dakusui/pcond/core/printable/ParameterizedFunctionFactory$Builder$1::toPrintableFunction → NO_COVERAGE
            return function;
28 1 1. toPrintableFunction : replaced return value with null for com/github/dakusui/pcond/core/printable/ParameterizedFunctionFactory$Builder$1::toPrintableFunction → KILLED
          return PrintableFunctionFactory.function(() -> {
29
                assert false;
30 1 1. lambda$toPrintableFunction$0 : replaced return value with "" for com/github/dakusui/pcond/core/printable/ParameterizedFunctionFactory$Builder$1::lambda$toPrintableFunction$0 → NO_COVERAGE
                return null;
31
              },
32
              function,
33
              this);
34
        }
35
      };
36
    }
37
  }
38
}

Mutations

14

1.1
Location : buildProtected
Killed by : com.github.dakusui.pcond.experimentals.TestAssertionsCurriedFunctionsTest.parameterizedFunctionTest(com.github.dakusui.pcond.experimentals.TestAssertionsCurriedFunctionsTest)
replaced return value with null for com/github/dakusui/pcond/core/printable/ParameterizedFunctionFactory$Builder::buildProtected → KILLED

19

1.1
Location : create
Killed by : com.github.dakusui.pcond.experimentals.TestAssertionsCurriedFunctionsTest.parameterizedFunctionTest(com.github.dakusui.pcond.experimentals.TestAssertionsCurriedFunctionsTest)
replaced return value with null for com/github/dakusui/pcond/core/printable/ParameterizedFunctionFactory$Builder$1::create → KILLED

26

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

27

1.1
Location : toPrintableFunction
Killed by : none
replaced return value with null for com/github/dakusui/pcond/core/printable/ParameterizedFunctionFactory$Builder$1::toPrintableFunction → NO_COVERAGE

28

1.1
Location : toPrintableFunction
Killed by : com.github.dakusui.pcond.experimentals.TestAssertionsCurriedFunctionsTest.parameterizedFunctionTest(com.github.dakusui.pcond.experimentals.TestAssertionsCurriedFunctionsTest)
replaced return value with null for com/github/dakusui/pcond/core/printable/ParameterizedFunctionFactory$Builder$1::toPrintableFunction → KILLED

30

1.1
Location : lambda$toPrintableFunction$0
Killed by : none
replaced return value with "" for com/github/dakusui/pcond/core/printable/ParameterizedFunctionFactory$Builder$1::lambda$toPrintableFunction$0 → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.7.3