Passport.kt

1
package com.adventofcode.day04
2
3
class Passport(internal val data: Map<DataField, String>) {
4
5
    override fun toString(): String {
6 1 1. toString : replaced return value with "" for com/adventofcode/day04/Passport::toString → KILLED
        return "Passport(${data.toSortedMap()})"
7
    }
8
9
10
    companion object {
11
        fun fromInput(input: String): Passport {
12
            return Passport(input.split(" ", "\n")
13
                    .map { it.split(":") }
14 4 1. fromInput : negated conditional → KILLED
2. fromInput : negated conditional → KILLED
3. fromInput : negated conditional → KILLED
4. fromInput : negated conditional → KILLED
                    .filter { !it.first().isNullOrEmpty() }
15
                    .map { Pair(DataField.valueOf(it.first().toUpperCase()), it.last()) }
16
                    .toMap()
17
            )
18
        }
19
    }
20
21
22
23
24
}

Mutations

6

1.1
Location : toString
Killed by : com.adventofcode.day04.PassportTest.[engine:junit-jupiter]/[class:com.adventofcode.day04.PassportTest]/[method:shouldDisplayDataNicely()]
replaced return value with "" for com/adventofcode/day04/Passport::toString → KILLED

14

1.1
Location : fromInput
Killed by : com.adventofcode.day04.PassportScannerTest.[engine:junit-jupiter]/[class:com.adventofcode.day04.PassportScannerTest]/[method:shouldReadPassportFromRawDataWithOneBreakLine()]
negated conditional → KILLED

2.2
Location : fromInput
Killed by : com.adventofcode.day04.PassportScannerTest.[engine:junit-jupiter]/[class:com.adventofcode.day04.PassportScannerTest]/[method:shouldReadPassportFromRawDataWithOneBreakLine()]
negated conditional → KILLED

3.3
Location : fromInput
Killed by : com.adventofcode.day04.PassportScannerTest.[engine:junit-jupiter]/[class:com.adventofcode.day04.PassportScannerTest]/[method:shouldReadPassportFromRawDataWithOneBreakLine()]
negated conditional → KILLED

4.4
Location : fromInput
Killed by : com.adventofcode.day04.PassportScannerTest.[engine:junit-jupiter]/[class:com.adventofcode.day04.PassportScannerTest]/[method:shouldReadPassportFromRawDataWithOneBreakLine()]
negated conditional → KILLED

Active mutators

Tests examined


Report generated by PIT 1.6.1