[TASK] Solved Day 5

This commit is contained in:
2023-12-05 21:15:47 +01:00
parent ead47e232e
commit b3cfc775e4
7 changed files with 449 additions and 15 deletions

View File

@@ -1,15 +1,14 @@
use crate::day_solver::DaySolver;
use super::util;
#[cfg(test)]
use crate::util::read_file;
pub struct DayX {
}
impl DayX {
pub fn create(input_filename: String) -> Self {
let lines = util::read_file("input/dayX_example.txt");
// let lines = util::read_file("input/dayX.txt");
pub fn create(input: String) -> Self {
// let lines = input.lines();
// Put the input into the day struct
return DayX {}
@@ -30,12 +29,12 @@ impl DaySolver for DayX {
#[test]
fn test_part1() {
let mut day = DayX::create("input/dayX_example.txt".to_string());
assert_eq!("4361", day.solve_part1());
let mut day = DayX::create(read_file("input/dayX_example.txt"));
assert_eq!("EXAMPLE_ANSWER", day.solve_part1());
}
#[test]
fn test_part2() {
let mut day = DayX::create("input/dayX_example.txt".to_string());
assert_eq!("467835", day.solve_part2());
let mut day = DayX::create(read_file("input/dayX_example.txt"));
assert_eq!("EXAMPLE_ANSWER", day.solve_part2());
}