StandardPlaceholder.java

1
package pro.verron.officestamper.core;
2
3
import pro.verron.officestamper.api.Placeholder;
4
5
/**
6
 * The StandardPlaceholder class represents a placeholder with a specific
7
 * matching condition and associated expression.
8
 * It uses a {@link Matcher} to determine if the placeholder expression matches
9
 * a given prefix and suffix, and to extract the inner content of the placeholder.
10
 */
11
public record StandardPlaceholder(Matcher matcher, String expression)
12
        implements Placeholder {
13
14
    @Override
15
    public String content() {
16 2 1. content : negated conditional → KILLED
2. content : replaced return value with "" for pro/verron/officestamper/core/StandardPlaceholder::content → KILLED
        return matcher.match(expression) ? matcher.strip(expression) : expression;
17
    }
18
19
    @Override
20
    public String toString() {
21 1 1. toString : replaced return value with "" for pro/verron/officestamper/core/StandardPlaceholder::toString → SURVIVED
        return "[%s]".formatted(expression);
22
    }
23
}

Mutations

16

1.1
Location : content
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#28]
negated conditional → KILLED

2.2
Location : content
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#29]
replaced return value with "" for pro/verron/officestamper/core/StandardPlaceholder::content → KILLED

21

1.1
Location : toString
Killed by : none
replaced return value with "" for pro/verron/officestamper/core/StandardPlaceholder::toString → SURVIVED
Covering tests

Active mutators

Tests examined


Report generated by PIT 1.20.0