[TASK] Solved Day 5
This commit is contained in:
17
src/dayX.rs
17
src/dayX.rs
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user