Added day 7
This commit is contained in:
66
src/solutions/day07.rs
Normal file
66
src/solutions/day07.rs
Normal file
@ -0,0 +1,66 @@
|
||||
use super::Solution;
|
||||
|
||||
pub struct Day07 {}
|
||||
|
||||
impl Solution for Day07 {
|
||||
fn part1(
|
||||
&self,
|
||||
_input: &mut Vec<String>,
|
||||
) -> Result<Box<dyn std::fmt::Display + Sync>, Box<dyn std::error::Error>> {
|
||||
Ok(Box::new("Ready"))
|
||||
}
|
||||
|
||||
fn part2(
|
||||
&self,
|
||||
_input: &mut Vec<String>,
|
||||
) -> Result<Box<dyn std::fmt::Display + Sync>, Box<dyn std::error::Error>> {
|
||||
Ok(Box::new("Ready"))
|
||||
}
|
||||
|
||||
fn get_day(&self) -> u8 {
|
||||
7
|
||||
}
|
||||
}
|
||||
|
||||
impl Day07 {}
|
||||
|
||||
/// Test from puzzle input
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use crate::*;
|
||||
|
||||
#[test]
|
||||
fn part1() {
|
||||
let challenge = day07::Day07 {};
|
||||
|
||||
//Complete the Challenge
|
||||
let answer = challenge
|
||||
.part1(
|
||||
utils::get_input(challenge.get_day(), utils::InputType::Test1)
|
||||
.unwrap()
|
||||
.as_mut(),
|
||||
)
|
||||
.unwrap()
|
||||
.to_string();
|
||||
|
||||
assert_eq!(answer, "Ready");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn part2() {
|
||||
let challenge = day07::Day07 {};
|
||||
|
||||
//Complete the Challenge
|
||||
let answer = challenge
|
||||
.part2(
|
||||
utils::get_input(challenge.get_day(), utils::InputType::Test2)
|
||||
.unwrap()
|
||||
.as_mut(),
|
||||
)
|
||||
.unwrap()
|
||||
.to_string();
|
||||
|
||||
assert_eq!(answer, "Ready");
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ pub mod day03;
|
||||
pub mod day04;
|
||||
pub mod day05;
|
||||
pub mod day06;
|
||||
pub mod day07;
|
||||
|
||||
use crate::utils::{self, get_input};
|
||||
use std::{error::Error, fmt::Display, time::SystemTime};
|
||||
|
Reference in New Issue
Block a user