feat!: rename test_inputs back to examples

This commit is contained in:
Matej Janezic 2022-12-15 14:40:53 +01:00
parent 000001900c
commit 0000020049
Signed by: janezicmatej
GPG Key ID: 4298E230ED37B2C0
6 changed files with 12 additions and 12 deletions

14
Cargo.lock generated
View File

@ -24,7 +24,7 @@ dependencies = [
[[package]] [[package]]
name = "aoc" name = "aoc"
version = "17.0.0" version = "20.0.0"
dependencies = [ dependencies = [
"dotenv", "dotenv",
"hashbrown 0.13.1", "hashbrown 0.13.1",
@ -68,9 +68,9 @@ checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.77" version = "1.0.78"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
@ -353,9 +353,9 @@ dependencies = [
[[package]] [[package]]
name = "ipnet" name = "ipnet"
version = "2.5.1" version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e"
[[package]] [[package]]
name = "itertools" name = "itertools"
@ -666,9 +666,9 @@ dependencies = [
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.149" version = "1.0.150"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91"
[[package]] [[package]]
name = "serde_json" name = "serde_json"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "aoc" name = "aoc"
version = "19.0.0" version = "20.0.0"
edition = "2021" edition = "2021"
authors = ["Matej Janežič <janezic.mj@gmail.com>"] authors = ["Matej Janežič <janezic.mj@gmail.com>"]
default-run = "aoc" default-run = "aoc"

View File

@ -10,7 +10,7 @@
- `<day>.rs`: solution files - `<day>.rs`: solution files
- `*.rs`: convenience scripts - `*.rs`: convenience scripts
- `inputs/`: this directory is gitignored, input files go here - `inputs/`: this directory is gitignored, input files go here
- `test_inputs/`: example files go here; you can push this as test are run in ci - `examples/`: example files go here; you can push this as test are run in ci
- `helpers.rs`: helper functions you can reuse in solution files go here - `helpers.rs`: helper functions you can reuse in solution files go here
- `lib.rs`: contains framework code - `lib.rs`: contains framework code
- `main.rs`: contains framework code - `main.rs`: contains framework code

View File

@ -24,12 +24,12 @@ mod tests {
use super::*; use super::*;
#[test] #[test]
fn test_part_one() { fn test_part_one() {
let input = aoc::read_file("test_inputs", DAY); let input = aoc::read_file("examples", DAY).trim();
assert_eq!(part_one(&input), None); assert_eq!(part_one(&input), None);
} }
#[test] #[test]
fn test_part_two() { fn test_part_two() {
let input = aoc::read_file("test_inputs", DAY); let input = aoc::read_file("examples", DAY).trim();
assert_eq!(part_two(&input), None); assert_eq!(part_two(&input), None);
} }
} }
@ -55,7 +55,7 @@ fn main() {
let day_padded = format!("{day:02}"); let day_padded = format!("{day:02}");
let input_path = format!("src/inputs/{day_padded}.txt"); let input_path = format!("src/inputs/{day_padded}.txt");
let example_path = format!("src/test_inputs/{day_padded}.txt"); let example_path = format!("src/examples/{day_padded}.txt");
let module_path = format!("src/bin/{day_padded}.rs"); let module_path = format!("src/bin/{day_padded}.rs");
let mut file = match safe_create_file(&module_path) { let mut file = match safe_create_file(&module_path) {

View File