[TASK] Day 4 + performance improvements
This commit is contained in:
14
src/dayX.rs
14
src/dayX.rs
@@ -7,7 +7,7 @@ pub struct DayX {
|
||||
|
||||
impl DayX {
|
||||
|
||||
pub fn create() -> Self {
|
||||
pub fn create(input_filename: String) -> Self {
|
||||
let lines = util::read_file("input/dayX_example.txt");
|
||||
// let lines = util::read_file("input/dayX.txt");
|
||||
|
||||
@@ -27,3 +27,15 @@ impl DaySolver for DayX {
|
||||
return 0.to_string();
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_part1() {
|
||||
let mut day = DayX::create("input/dayX_example.txt".to_string());
|
||||
assert_eq!("4361", day.solve_part1());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_part2() {
|
||||
let mut day = DayX::create("input/dayX_example.txt".to_string());
|
||||
assert_eq!("467835", day.solve_part2());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user