34 lines
563 B
Rust
34 lines
563 B
Rust
#[cfg(test)]
|
|
mod examples {
|
|
use day48::tree;
|
|
|
|
#[test]
|
|
fn test1() {
|
|
assert_eq!(tree(1), vec!["#"]);
|
|
}
|
|
|
|
#[test]
|
|
fn test2() {
|
|
assert_eq!(tree(2), vec![" # ", "###"]);
|
|
}
|
|
|
|
#[test]
|
|
fn test3() {
|
|
assert_eq!(
|
|
tree(5),
|
|
vec![
|
|
" # ",
|
|
" ### ",
|
|
" ##### ",
|
|
" ####### ",
|
|
"#########"
|
|
]
|
|
);
|
|
}
|
|
|
|
#[test]
|
|
fn test4() {
|
|
assert_eq!(tree(0), Vec::<String>::new());
|
|
}
|
|
}
|