Skip to content

Commit

Permalink
Add tests for 2023 puzzles, day 1 + 2
Browse files Browse the repository at this point in the history
* Add test resources
  • Loading branch information
EdricChan03 committed May 20, 2024
1 parent d54c45f commit 7fc866b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.edricchan.aoc.year2023

import com.edricchan.aoc.puzzle.dsl.puzzle
import com.edricchan.aoc.puzzle.dsl.puzzles
import com.edricchan.aoc.puzzle.input.input
import java.time.Year

val puzzles = puzzles(Year.of(2023)) {
puzzle(1, Day01(), 142, 142 /* same result... */)
resourceLoader.getResourceAsPath("input-words.txt")?.let { path ->
puzzle(1, ::Day01) {
// Part 1 assumes that lines with no valid values are skipped
withInput(path.input, 209, 281)
}
}

puzzle(2, Day02(), 8, 2286)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.edricchan.aoc.year2023

import com.edricchan.aoc.puzzle.AbstractPuzzleTests

class Year2023Tests : AbstractPuzzleTests(puzzles)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
two1nine
eightwothree
abcone2threexyz
xtwone3four
4nineeightseven2
zoneight234
7pqrstsixteen
4 changes: 4 additions & 0 deletions solutions/src/test/resources/aoc/year2023/day1/input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1abc2
pqr3stu8vwx
a1b2c3d4e5f
treb7uchet
5 changes: 5 additions & 0 deletions solutions/src/test/resources/aoc/year2023/day2/input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue
Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green

0 comments on commit 7fc866b

Please sign in to comment.