-
Notifications
You must be signed in to change notification settings - Fork 0
/
Day21Test.kt
50 lines (43 loc) · 1.26 KB
/
Day21Test.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
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.Ignore
import kotlin.test.Test
import kotlin.test.assertEquals
@DisplayName("Day 21")
internal class Day21Test {
@Nested
inner class Example {
private val day = Day21(resourceAsLines("day21_example"))
@Test
fun puzzle1() {
assertEquals(16, day.puzzle1(6))
}
@Ignore
@Test
fun puzzle2() {
assertEquals(16, day.puzzle2(6))
assertEquals(50, day.puzzle2(10))
assertEquals(1_594, day.puzzle2(50))
assertEquals(6_536, day.puzzle2(100))
assertEquals(167_004, day.puzzle2(500))
assertEquals(668_697, day.puzzle2(1_000))
assertEquals(16_733_044, day.puzzle2(5_000))
}
}
@Nested
@Tag("personal")
inner class Problem {
private val day = Day21(resourceAsLines("day21"))
@Test
fun puzzle1() {
assertEquals(3_773, day.puzzle1(64))
}
@Test
fun puzzle2() {
assertEquals(625_628_021_226_274, day.puzzle2(26_501_365))
}
}
}