File tree 3 files changed +13
-3
lines changed
main/kotlin/com/github/hsz/aoc
test/kotlin/com/github/hsz/aoc
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package com.github.hsz.aoc
2
2
3
3
import com.github.hsz.aoc.utils.Resources
4
4
5
- abstract class Day (number : Number ) {
5
+ abstract class Day (val number : Number ) {
6
6
7
7
private val input = Resources .asString(" day${number.toString().padStart(2 , ' 0' )} .txt" )
8
8
Original file line number Diff line number Diff line change @@ -8,13 +8,13 @@ class Day01Test : DayTest() {
8
8
override val day = Day01 ()
9
9
10
10
@Test
11
- fun part1 () {
11
+ fun `Part 1` () {
12
12
assertEquals(0 , day.part1(" foo" )) // check against test input
13
13
assertEquals(0 , day.part1()) // check against input data
14
14
}
15
15
16
16
@Test
17
- fun part2 () {
17
+ fun `Part 2` () {
18
18
assertEquals(0 , day.part2(" bar" ))
19
19
assertEquals(0 , day.part2())
20
20
}
Original file line number Diff line number Diff line change @@ -3,7 +3,17 @@ package com.github.hsz.aoc
3
3
import org.junit.jupiter.api.AfterAll
4
4
import org.junit.jupiter.api.TestInstance
5
5
6
+ @TestInstance(TestInstance .Lifecycle .PER_CLASS )
6
7
abstract class DayTest {
7
8
8
9
abstract val day: Day
10
+
11
+ @AfterAll
12
+ fun solve () {
13
+ with (day) {
14
+ println (" Solutions for Day $number :" )
15
+ println (" Part 1: ${part1()} " )
16
+ println (" Part 2: ${part2()} " )
17
+ }
18
+ }
9
19
}
You can’t perform that action at this time.
0 commit comments