31 lines
531 B
Rust
31 lines
531 B
Rust
|
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
|
||
|
))
|
||
|
}
|