1
0
This commit is contained in:
2020-12-18 12:12:58 +01:00
parent 264ba1cb91
commit b0001697f5
3 changed files with 560 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
package be.vandewalleh.aoc.days
import be.vandewalleh.aoc.utils.input.Input
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.CsvSource
class Day18Test {
@CsvSource(value = [
"1 + 2 * 3 + 4 * 5 + 6 , 231",
"1 + (2 * 3) + (4 * (5 + 6)) , 51",
"2 * 3 + (4 * 5) , 46",
"5 + (8 * 3 + 9 + 3 * 4 * 3) , 1445", // !!!
"5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4)) , 669060",
"((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2 , 23340"
])
@ParameterizedTest
fun examplesPart2(input: String, output: Long) {
val day18 = Day18(Input(listOf(input)))
assertThat(day18.part2()).isEqualTo(output)
}
}