-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay07Test.kt
54 lines (48 loc) · 1.27 KB
/
Day07Test.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package io.dmitrijs.aoc2017
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Nested
import kotlin.test.Test
import kotlin.test.assertEquals
@DisplayName("Day 7")
internal class Day07Test {
private val problemInput = Resources.resourceAsLines("day07")
private val exampleInput = """
pbga (66)
xhth (57)
ebii (61)
havc (66)
ktlj (57)
fwft (72) -> ktlj, cntj, xhth
qoyq (66)
padx (45) -> pbga, havc, qoyq
tknk (41) -> ugml, padx, fwft
jptl (61)
ugml (68) -> gyxo, ebii, jptl
gyxo (61)
cntj (57)
""".trimIndent().lines()
@Nested
@DisplayName("Puzzle 1")
inner class Puzzle1 {
@Test
fun `solves example`() {
assertEquals("tknk", Day07(exampleInput).puzzle1())
}
@Test
fun `solves problem`() {
assertEquals("aapssr", Day07(problemInput).puzzle1())
}
}
@Nested
@DisplayName("Puzzle 2")
inner class Puzzle2 {
@Test
fun `solves example`() {
assertEquals(60, Day07(exampleInput).puzzle2())
}
@Test
fun `solves problem`() {
assertEquals(1_458, Day07(problemInput).puzzle2())
}
}
}