WinScreenLogic.java

1
package io.github.some_example_name;
2
3
public class WinScreenLogic {
4
5
    private StringBuilder input;
6
    private boolean nameConfirmed;
7
    private float cursorTimer;
8
    private boolean cursorVisible;
9
10
    public WinScreenLogic() {
11
        input = new StringBuilder();
12
        nameConfirmed = false;
13
        cursorTimer = 0f;
14
        cursorVisible = true;
15
    }
16
17
    public String getName() {
18 1 1. getName : replaced return value with "" for io/github/some_example_name/WinScreenLogic::getName → KILLED
        return input.toString();
19
    }
20
21
    public boolean isNameConfirmed() {
22 2 1. isNameConfirmed : replaced boolean return with true for io/github/some_example_name/WinScreenLogic::isNameConfirmed → SURVIVED
2. isNameConfirmed : replaced boolean return with false for io/github/some_example_name/WinScreenLogic::isNameConfirmed → KILLED
        return nameConfirmed;
23
    }
24
25
    public void processKeyTyped(char character) {
26 1 1. processKeyTyped : negated conditional → KILLED
        if (nameConfirmed) return;
27
28 1 1. processKeyTyped : negated conditional → KILLED
        if (character == '\b') {
29 2 1. processKeyTyped : changed conditional boundary → SURVIVED
2. processKeyTyped : negated conditional → KILLED
            if (input.length() > 0) {
30 1 1. processKeyTyped : Replaced integer subtraction with addition → KILLED
                input.deleteCharAt(input.length() - 1);
31
            }
32
            return;
33
        }
34
35 2 1. processKeyTyped : negated conditional → KILLED
2. processKeyTyped : negated conditional → KILLED
        if (character == '\r' || character == '\n') {
36 2 1. processKeyTyped : changed conditional boundary → KILLED
2. processKeyTyped : negated conditional → KILLED
            if (input.length() > 0) {
37
                nameConfirmed = true;
38
            }
39
            return;
40
        }
41
42 2 1. processKeyTyped : negated conditional → KILLED
2. processKeyTyped : changed conditional boundary → KILLED
        if (input.length() >= 12) return;
43
44 2 1. processKeyTyped : negated conditional → KILLED
2. processKeyTyped : negated conditional → KILLED
        if (Character.isLetterOrDigit(character) || character == ' ') {
45
            input.append(character);
46
        }
47
    }
48
49
    public void update(float delta) {
50 1 1. update : Replaced float addition with subtraction → KILLED
        cursorTimer += delta;
51 2 1. update : changed conditional boundary → SURVIVED
2. update : negated conditional → KILLED
        if (cursorTimer >= 0.5f) {
52 1 1. update : negated conditional → KILLED
            cursorVisible = !cursorVisible;  // Toggle cursor visibility
53
            cursorTimer = 0f;
54
        }
55
    }
56
57
    public boolean isCursorVisible() {
58 2 1. isCursorVisible : replaced boolean return with false for io/github/some_example_name/WinScreenLogic::isCursorVisible → KILLED
2. isCursorVisible : replaced boolean return with true for io/github/some_example_name/WinScreenLogic::isCursorVisible → KILLED
        return cursorVisible;
59
    }
60
61
    public void resetInput() {
62 1 1. resetInput : removed call to java/lang/StringBuilder::setLength → NO_COVERAGE
        input.setLength(0);
63
        nameConfirmed = false;
64
    }
65
}

Mutations

18

1.1
Location : getName
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[test-template:nameInputIsProcessedCorrectly(char)]/[test-template-invocation:#1]
replaced return value with "" for io/github/some_example_name/WinScreenLogic::getName → KILLED

22

1.1
Location : isNameConfirmed
Killed by : none
replaced boolean return with true for io/github/some_example_name/WinScreenLogic::isNameConfirmed → SURVIVED

2.2
Location : isNameConfirmed
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[method:nameConfirmationWorks()]
replaced boolean return with false for io/github/some_example_name/WinScreenLogic::isNameConfirmed → KILLED

26

1.1
Location : processKeyTyped
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[test-template:nameInputIsProcessedCorrectly(char)]/[test-template-invocation:#1]
negated conditional → KILLED

28

1.1
Location : processKeyTyped
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[test-template:nameInputIsProcessedCorrectly(char)]/[test-template-invocation:#1]
negated conditional → KILLED

29

1.1
Location : processKeyTyped
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : processKeyTyped
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[method:backspaceRemovesLastCharacter()]
negated conditional → KILLED

30

1.1
Location : processKeyTyped
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[method:backspaceRemovesLastCharacter()]
Replaced integer subtraction with addition → KILLED

35

1.1
Location : processKeyTyped
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[test-template:nameInputIsProcessedCorrectly(char)]/[test-template-invocation:#1]
negated conditional → KILLED

2.2
Location : processKeyTyped
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[test-template:nameInputIsProcessedCorrectly(char)]/[test-template-invocation:#1]
negated conditional → KILLED

36

1.1
Location : processKeyTyped
Killed by : io.github.some_example_name.WinToLeaderboardIntegrationTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinToLeaderboardIntegrationTest]/[method:confirmedWinNameIsWrittenToLeaderboard()]
changed conditional boundary → KILLED

2.2
Location : processKeyTyped
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[method:noInputAfterConfirmation()]
negated conditional → KILLED

42

1.1
Location : processKeyTyped
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[test-template:nameInputIsProcessedCorrectly(char)]/[test-template-invocation:#1]
negated conditional → KILLED

2.2
Location : processKeyTyped
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[method:nameLengthLimitWorks()]
changed conditional boundary → KILLED

44

1.1
Location : processKeyTyped
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[test-template:nameInputIsProcessedCorrectly(char)]/[test-template-invocation:#1]
negated conditional → KILLED

2.2
Location : processKeyTyped
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[test-template:nameInputIsProcessedCorrectly(char)]/[test-template-invocation:#4]
negated conditional → KILLED

50

1.1
Location : update
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[method:cursorBlinkingWorks()]
Replaced float addition with subtraction → KILLED

51

1.1
Location : update
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[method:cursorBlinkingWorks()]
negated conditional → KILLED

2.2
Location : update
Killed by : none
changed conditional boundary → SURVIVED

52

1.1
Location : update
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[method:cursorBlinkingWorks()]
negated conditional → KILLED

58

1.1
Location : isCursorVisible
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[method:cursorBlinkingWorks()]
replaced boolean return with false for io/github/some_example_name/WinScreenLogic::isCursorVisible → KILLED

2.2
Location : isCursorVisible
Killed by : io.github.some_example_name.WinScreenLogicTest.[engine:junit-jupiter]/[class:io.github.some_example_name.WinScreenLogicTest]/[method:cursorBlinkingWorks()]
replaced boolean return with true for io/github/some_example_name/WinScreenLogic::isCursorVisible → KILLED

62

1.1
Location : resetInput
Killed by : none
removed call to java/lang/StringBuilder::setLength → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.15.0