Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: test file generator #11

Merged
merged 7 commits into from
Dec 2, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: expand README with test generation
  • Loading branch information
S-ecki committed Dec 2, 2023
commit 24381db63c01d8a105c52729b2e678668e5a7cf7
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,14 @@ After that, get your session token from the cookie:
Add the value to the `session` variable in the `day_generator.dart` file . This will allow the script to populate your input file.


### Naming conventions

When using the Boilerplate generator, everything is done for you automatically. However, if you create a solution or input file by yourself: make sure it has a 2-digit number. Concretely, pad days 1-9 as `Day01.dart` for solutions and `aoc01.txt` for input.


### Boilerplate Generation

In the root of your directory, run
```dart
dart run day_generator.dart <day>
```

This will create an input file and a solution file with all the needed boilerplate to have a quick start. It also adds the solution to the corresponding index file, so the solution get imported into `main` automatically.
This will create an input and test file and a solution file with all the needed boilerplate to have a quick start. It also adds the solution to the corresponding index file, so the solution get imported into `main` automatically.

### Main

Expand All @@ -51,6 +46,23 @@ in the root of your directory.
By default the main file will only show the last solution. If you want to see all of them, you can use the `-a` or `--all` flag.
You can list all the command line arguments by using the `-h` or `--help` flag.

### Tests

A test file is automatically generated for each day. It contains tests for both parts of the example and the real input.

All you have to do is **fill out the variables given at the top of the test file.**

---

## Class Documentation

Below you can find a short documentation of the classes and methods provided by this starter project.

### Naming conventions

When using the Boilerplate generator, everything is done for you automatically. However, if you create a solution or input file by yourself: make sure it has a 2-digit number. Concretely, pad days 1-9 as `Day01.dart` for solutions and `aoc01.txt` for input.


### Generic Day

The abstract class all individual days subclass from. When constructed with the correct `day`, it automatically ready the corresponding input file and provides it with the `InputUtil`. To access it, just call `input` inside your class.
Expand Down