-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay7KtTest.kt
33 lines (27 loc) · 893 Bytes
/
Day7KtTest.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
package aoc2015.day07
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import util.not
internal class Day7KtTest {
private val input = "src/main/kotlin/aoc2015/day07/input"
private val inputPart2 = "src/main/kotlin/aoc2015/day07/inputPart2"
private val testInput = "src/main/kotlin/aoc2015/day07/testInput"
@Test
fun testPart1() {
assertEquals(72, Day7(testInput).readInputAndRun())
assertEquals(956, Day7(input).readInputAndRun())
}
@Test
fun testPart2() {
assertEquals(40149, Day7(inputPart2).readInputAndRun())
}
@Test
fun testBitOperations() {
assertEquals(72, 123 and 456)
assertEquals(507, 123 or 456)
assertEquals(492, 123 shl 2)
assertEquals(114, 456 shr 2)
assertEquals(65412, not(123))
assertEquals(65079, not(456))
}
}