day01 finished
This commit is contained in:
parent
284f099d3e
commit
68fefd064a
9 changed files with 2487 additions and 164 deletions
|
|
@ -1,20 +1,50 @@
|
|||
use anyhow::Result;
|
||||
|
||||
use super::template::{Day, ResultType};
|
||||
use super::template::{DayTrait, ResultType};
|
||||
|
||||
pub struct Day;
|
||||
const DAY_NUMBER: usize = 0;
|
||||
|
||||
impl DayTemplate for Day {
|
||||
pub struct Day;
|
||||
|
||||
impl DayTrait for Day {
|
||||
fn get_day_number(&self) -> usize {
|
||||
DAY_NUMBER
|
||||
}
|
||||
|
||||
fn part1(&self, lines: String) -> Result<ResultType> {
|
||||
fn part1(&self, _lines: &str) -> Result<ResultType> {
|
||||
Ok(ResultType::NoResult)
|
||||
}
|
||||
|
||||
fn part2(&self, lines: String) -> Result<ResultType> {
|
||||
fn part2(&self, _lines: &str) -> Result<ResultType> {
|
||||
Ok(ResultType::NoResult)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use crate::common::file::read_data;
|
||||
use anyhow::Result;
|
||||
|
||||
#[test]
|
||||
fn test_part1() -> Result<()> {
|
||||
let day = Day {};
|
||||
let lines = read_data(day.get_day_number(), "example01.txt")?;
|
||||
let expected = ResultType::NoResult;
|
||||
let result = day.part1(&lines)?;
|
||||
assert_eq!(result, expected);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_part2() -> Result<()> {
|
||||
let day = Day {};
|
||||
let lines = read_data(day.get_day_number(), "example01.txt")?;
|
||||
let expected = ResultType::NoResult;
|
||||
let result = day.part2(&lines)?;
|
||||
assert_eq!(result, expected);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue