Identifiers.java

1
package com.rox.cpu.mos6502.assembler;
2
3
/** Shared identifier-name validation for labels, used by both label parsing and operand parsing. */
4
final class Identifiers {
5
6
    private Identifiers() {
7
    }
8
9
    static boolean isValidLabelName(final String text) {
10 3 1. isValidLabelName : negated conditional → KILLED
2. isValidLabelName : negated conditional → KILLED
3. isValidLabelName : negated conditional → KILLED
        if (text.isEmpty() || !(Character.isLetter(text.charAt(0)) || text.charAt(0) == '_')) {
11 1 1. isValidLabelName : replaced boolean return with true for com/rox/cpu/mos6502/assembler/Identifiers::isValidLabelName → KILLED
            return false;
12
        }
13 2 1. isValidLabelName : changed conditional boundary → KILLED
2. isValidLabelName : negated conditional → KILLED
        for (int i = 1; i < text.length(); i++) {
14
            final char c = text.charAt(i);
15 2 1. isValidLabelName : negated conditional → KILLED
2. isValidLabelName : negated conditional → KILLED
            if (!Character.isLetterOrDigit(c) && c != '_') {
16 1 1. isValidLabelName : replaced boolean return with true for com/rox/cpu/mos6502/assembler/Identifiers::isValidLabelName → KILLED
                return false;
17
            }
18
        }
19 1 1. isValidLabelName : replaced boolean return with false for com/rox/cpu/mos6502/assembler/Identifiers::isValidLabelName → KILLED
        return true;
20
    }
21
}

Mutations

10

1.1
Location : isValidLabelName
Killed by : com.rox.cpu.mos6502.assembler.LineScannerTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.LineScannerTest]/[nested-class:LabelLines]/[method:emptyTextBeforeAColonIsNotTreatedAsALabel()]
negated conditional → KILLED

2.2
Location : isValidLabelName
Killed by : com.rox.cpu.mos6502.assembler.OperandParserTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.OperandParserTest]/[nested-class:LabelReferences]/[test-template:bareIdentifiersAreLabelReferences(java.lang.String)]/[test-template-invocation:#4]
negated conditional → KILLED

3.3
Location : isValidLabelName
Killed by : com.rox.cpu.mos6502.assembler.OperandParserTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.OperandParserTest]/[nested-class:LabelReferences]/[test-template:bareIdentifiersAreLabelReferences(java.lang.String)]/[test-template-invocation:#3]
negated conditional → KILLED

11

1.1
Location : isValidLabelName
Killed by : com.rox.cpu.mos6502.assembler.LineScannerTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.LineScannerTest]/[nested-class:LabelLines]/[method:emptyTextBeforeAColonIsNotTreatedAsALabel()]
replaced boolean return with true for com/rox/cpu/mos6502/assembler/Identifiers::isValidLabelName → KILLED

13

1.1
Location : isValidLabelName
Killed by : com.rox.cpu.mos6502.assembler.OperandParserTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.OperandParserTest]/[nested-class:LabelReferences]/[test-template:bareIdentifiersAreLabelReferences(java.lang.String)]/[test-template-invocation:#3]
changed conditional boundary → KILLED

2.2
Location : isValidLabelName
Killed by : com.rox.cpu.mos6502.assembler.LineScannerTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.LineScannerTest]/[nested-class:LabelLines]/[method:anInvalidCharacterAfterTheStartOfACandidateLabelPreventsItBeingRecognisedAsALabel()]
negated conditional → KILLED

15

1.1
Location : isValidLabelName
Killed by : com.rox.cpu.mos6502.assembler.OperandParserTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.OperandParserTest]/[nested-class:LabelReferences]/[test-template:bareIdentifiersAreLabelReferences(java.lang.String)]/[test-template-invocation:#3]
negated conditional → KILLED

2.2
Location : isValidLabelName
Killed by : com.rox.cpu.mos6502.assembler.OperandParserTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.OperandParserTest]/[nested-class:LabelReferences]/[test-template:bareIdentifiersAreLabelReferences(java.lang.String)]/[test-template-invocation:#4]
negated conditional → KILLED

16

1.1
Location : isValidLabelName
Killed by : com.rox.cpu.mos6502.assembler.LineScannerTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.LineScannerTest]/[nested-class:LabelLines]/[method:anInvalidCharacterAfterTheStartOfACandidateLabelPreventsItBeingRecognisedAsALabel()]
replaced boolean return with true for com/rox/cpu/mos6502/assembler/Identifiers::isValidLabelName → KILLED

19

1.1
Location : isValidLabelName
Killed by : com.rox.cpu.mos6502.assembler.OperandParserTest.[engine:junit-jupiter]/[class:com.rox.cpu.mos6502.assembler.OperandParserTest]/[nested-class:LabelReferences]/[test-template:bareIdentifiersAreLabelReferences(java.lang.String)]/[test-template-invocation:#3]
replaced boolean return with false for com/rox/cpu/mos6502/assembler/Identifiers::isValidLabelName → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1