100-days-of-rust/Week-02/Day-12_Mountains_And_Valleys/day12/tests/examples.rs

31 lines
531 B
Rust
Raw Normal View History

2024-08-06 14:20:08 +00:00
use day12::{landscape_type, LandscapeType};
#[test]
fn example1() {
assert!(matches!(
landscape_type(&[3, 4, 5, 4, 3]),
LandscapeType::Mountain
))
}
#[test]
fn example2() {
assert!(matches!(
landscape_type(&[9, 7, 3, 1, 2, 4]),
LandscapeType::Valley
))
}
#[test]
fn example3() {
assert!(matches!(landscape_type(&[9, 8, 9]), LandscapeType::Valley))
}
#[test]
fn example4() {
assert!(matches!(
landscape_type(&[9, 8, 9, 8]),
LandscapeType::Neither
))
}