generated from kotlin-hands-on/advent-of-code-kotlin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Day06Test.kt
44 lines (38 loc) · 1.2 KB
/
Day06Test.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
package io.dmitrijs.aoc2022
import io.dmitrijs.aoc2022.Resources.resourceAsText
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 6")
internal class Day06Test {
@Nested
inner class Example {
@Test
fun puzzle1() {
assertEquals(5, Day06("bvwbjplbgvbhsrlpgdmjqwftvncz").puzzle1())
assertEquals(6, Day06("nppdvjthqldpwncqszvftbrmjlhg").puzzle1())
assertEquals(10, Day06("nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg").puzzle1())
}
@Test
fun puzzle2() {
assertEquals(23, Day06("bvwbjplbgvbhsrlpgdmjqwftvncz").puzzle2())
assertEquals(23, Day06("nppdvjthqldpwncqszvftbrmjlhg").puzzle2())
assertEquals(29, Day06("nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg").puzzle2())
}
}
@Nested
@Tag("personal")
inner class Problem {
private val day = Day06(resourceAsText("day06"))
@Test
fun puzzle1() {
assertEquals(1_566, day.puzzle1())
}
@Test
fun puzzle2() {
assertEquals(2_265, day.puzzle2())
}
}
}