Skip to content

Commit

Permalink
unit-tests now do not fail if input files are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
norganos committed Dec 2, 2023
1 parent 7bb19f9 commit 6a2e5b1
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/main/kotlin/de/linkel/aoc/Day01.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import kotlin.math.min
@Singleton
class Day01: AbstractLinesAdventDay<Int>() {
override val day = 1
override val parts = QuizPart.BOTH

override fun process(part: QuizPart, lines: Sequence<String>): Int {
return lines
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/de/linkel/aoc/Day02.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import java.lang.Exception
@Singleton
class Day02: AbstractLinesAdventDay<Int>() {
override val day = 2
override val parts = QuizPart.BOTH

override fun process(part: QuizPart, lines: Sequence<String>): Int {
val linePattern = Regex("Game ([0-9]+): (.+)")
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/de/linkel/aoc/Day03.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import jakarta.inject.Singleton
@Singleton
class Day03: AbstractLinesAdventDay<Int>() {
override val day = 3
override val parts = QuizPart.BOTH

override fun process(part: QuizPart, lines: Sequence<String>): Int {
return 0
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/de/linkel/aoc/Day04.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import jakarta.inject.Singleton
@Singleton
class Day04: AbstractLinesAdventDay<Int>() {
override val day = 4
override val parts = QuizPart.BOTH

override fun process(part: QuizPart, lines: Sequence<String>): Int {
return 0
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/de/linkel/aoc/Main.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.linkel.aoc

import de.linkel.aoc.base.AdventDay
import de.linkel.aoc.base.QuizPart
import io.micronaut.configuration.picocli.PicocliRunner
import jakarta.inject.Inject
import picocli.CommandLine.Command
Expand Down Expand Up @@ -31,7 +32,7 @@ class Main : Runnable {
println("implementation for day $day not found")
exitProcess(1)
}
for (part in adventDay.parts) {
for (part in QuizPart.entries) {
adventDay.solve(part, args)
}
}
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/de/linkel/aoc/base/AdventDay.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package de.linkel.aoc.base

interface AdventDay<T> {
val day: Int
val parts: List<QuizPart>
fun test(part: QuizPart, input: String): T
fun solve(part: QuizPart, args: List<String>): T
fun solve(part: QuizPart): T {
Expand Down

0 comments on commit 6a2e5b1

Please sign in to comment.