Added tests section in the readme

This commit is contained in:
Stefan Müller 2024-06-26 09:34:05 +02:00
parent 72ce40d84a
commit 6d622d4c22
1 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,12 @@ This is a single command line application for all puzzles written in [FreePascal
This project does not contain the puzzle or example inputs as per the [copyright notice of Advent of Code](https://adventofcode.com/about). In order to run the compiled application, the puzzle inputs have to be downloaded from the [Advent of Code 2023](https://adventofcode.com/2023/) puzzle pages, and placed as text files into the `bin\data` directory, e.g. `bin\data\cube_conundrum.txt` or `bin\data\example\cube_conundrum.txt`. The application will output an error with details, if it cannot find an input file.
## Tests
On day 3, I introduced unit tests to help troubleshoot issues and prevent regressions while I kept iterating over the solver class framework. These tests cover the provided example solutions and occasional partial data tests whenever I felt the need for it.
I also added tests for the full puzzle data once I found the solution, but these tests are not public to not spoil the Advent of Code puzzles.
## Solutions
### Day 1: Trebuchet?!
@ -28,8 +34,6 @@ That one seemed pretty straight forward. For each line, the solution immediately
For this I modified the solver class to pass in three lines at once, shifting one line down in each iteration, processing the numbers in the middle line and looking for additional symbols in the lines before and after. The tricky part was to correctly track the data needed for processing of each line and discarding it in time, without resorting to reading all data in before processing.
I introduced the test framework for this puzzle while stumbling over quite a few bugs.
### Day 4: Scratchcards
:mag_right: Puzzle: <https://adventofcode.com/2023/day/4>, :white_check_mark: Solver: [`UScratchCards.pas`](solvers/UScratchCards.pas)