Skip to content

Commit

Permalink
2023 - Day07 - testing edge cases posted on reddit
Browse files Browse the repository at this point in the history
  • Loading branch information
fmmr committed Dec 7, 2023
1 parent 1d0a0c4 commit 30a37a4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/test/kotlin/no/rodland/advent_2023/Day07Test.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.Test
import readFile

@Suppress("ClassName")
@Suppress("ClassName", "PrivatePropertyName")
@DisableSlow
internal class Day07Test {
private val data07 = "2023/input_07.txt".readFile()

// https://www.reddit.com/r/adventofcode/comments/18cr4xr/2023_day_7_better_example_input_not_a_spoiler/
private val data07_2 = "2023/input_07_2.txt".readFile()
private val test07 = listOf(
"32T3K 765",
"T55J5 684",
Expand Down Expand Up @@ -70,6 +73,8 @@ internal class Day07Test {

@Nested
inner class `Part 2` {


@Test
fun `07,2,test`() {
report(test.testPart2)
Expand All @@ -80,4 +85,19 @@ internal class Day07Test {
report(test.livePart2)
}
}

@Nested
inner class `Edge Cases` {
@Test
fun `07,1,live,edge`() {
val day = Day07(data07_2)
report(test.livePart1.copy(function = { day.partOne() }, expected = 4466L))
}

@Test
fun `07,2,live,edge`() {
val day = Day07(data07_2)
report(test.livePart2.copy(function = { day.partTwo() }, expected = 4657L))
}
}
}
16 changes: 16 additions & 0 deletions src/test/resources/2023/input_07_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
2345A 2
Q2Q2Q 13
2345J 5
J345A 3
32T3K 7
T55J5 19
KK677 11
KTJJT 29
QQQJA 23
JJJJJ 31
JAAAA 43
AAAAJ 53
AAAAA 59
2AAAA 17
2JJJJ 47
JJJJ2 34

0 comments on commit 30a37a4

Please sign in to comment.