boilerplate: add test boilerplate

This commit is contained in:
Keenan Tims 2023-12-07 20:56:08 -08:00
parent 9ab450d258
commit c8eb06a5ec
Signed by: ktims
GPG Key ID: 11230674D69038D4

View File

@ -25,3 +25,23 @@ fn problem1<T: BufRead>(input: Lines<T>) -> u64 {
fn problem2<T: BufRead>(input: Lines<T>) -> u64 { fn problem2<T: BufRead>(input: Lines<T>) -> u64 {
0 0
} }
#[cfg(test)]
mod tests {
use crate::*;
use std::io::Cursor;
const EXAMPLE: &str = &"";
#[test]
fn problem1_example() {
let c = Cursor::new(EXAMPLE);
assert_eq!(problem1(c.lines()), 0);
}
#[test]
fn problem2_example() {
let c = Cursor::new(EXAMPLE);
assert_eq!(problem2(c.lines()), 0);
}
}