File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed
kotlin/com/github/kotlinhandson/aoc
test/kotlin/com/github/kotlinhandson/aoc Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1
1
package com.github.kotlinhandson.aoc
2
2
3
+ import com.github.kotlinhandson.aoc.utils.ints
4
+
3
5
class Day01 : Day (1 ) {
4
6
5
7
override fun part1 (input : String ): Int {
6
- return 0
8
+ return input.ints().sum()
7
9
}
8
10
9
11
override fun part2 (input : String ): Int {
File renamed without changes.
Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ class Day01Test : DayTest() {
8
8
override val day = Day01 ()
9
9
10
10
@Test
11
- fun `Part 1` () {
12
- assertEquals(0 , day.part1(" foo " )) // check against test input
13
- assertEquals(0 , day.part1()) // check against input data
11
+ override fun `Part 1` () {
12
+ assertEquals(0 , day.part1(" test_input " )) // check against test input
13
+ assertEquals(0 , day.part1()) // check solution against input data
14
14
}
15
15
16
16
@Test
17
- fun `Part 2` () {
18
- assertEquals(0 , day.part2(" bar " ))
17
+ override fun `Part 2` () {
18
+ assertEquals(0 , day.part2(" test_input " ))
19
19
assertEquals(0 , day.part2())
20
20
}
21
21
}
Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ abstract class DayTest {
8
8
9
9
abstract val day: Day
10
10
11
+ abstract fun `Part 1` ()
12
+
13
+ abstract fun `Part 2` ()
14
+
11
15
@AfterAll
12
16
fun solve () {
13
17
with (day) {
You can’t perform that action at this time.
0 commit comments