100-days-of-rust/Week-07/Day-48_Christmas-Tree/day48/tests/examples.rs

34 lines
563 B
Rust
Raw Normal View History

2024-09-11 10:24:58 +00:00
#[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());
}
}