-
Notifications
You must be signed in to change notification settings - Fork 0
/
Day17Test.kt
63 lines (53 loc) · 1.49 KB
/
Day17Test.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
55
56
57
58
59
60
61
62
63
package io.dmitrijs.aoc2023
import io.dmitrijs.aoc2023.Resources.resourceAsLines
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.Tag
import kotlin.test.Test
import kotlin.test.assertEquals
@DisplayName("Day 17")
internal class Day17Test {
@Nested
inner class Example {
private val day = Day17(resourceAsLines("day17_example"))
@Test
fun puzzle1() {
assertEquals(102, day.puzzle1())
}
@Test
fun puzzle2() {
assertEquals(94, day.puzzle2())
// Additional example.
val input = """
111111111111
999999999991
999999999991
999999999991
999999999991
""".trimIndent().lines()
assertEquals(71, Day17(input).puzzle2())
}
}
@Nested
@Tag("personal")
inner class Problem {
private val day = Day17(resourceAsLines("day17"))
private val day17Simplified = Day17Simplified(resourceAsLines("day17"))
@Test
fun puzzle1() {
assertEquals(698, day.puzzle1())
}
@Test
fun puzzle1Simplified() {
assertEquals(698, day17Simplified.puzzle1())
}
@Test
fun puzzle2() {
assertEquals(825, day.puzzle2())
}
@Test
fun puzzle2Simplified() {
assertEquals(825, day17Simplified.puzzle2())
}
}
}