100-days-of-rust/Week-05/Day-35_Dog-And-Gopher/day35/tests/examples.rs

51 lines
1.2 KiB
Rust
Raw Normal View History

2024-08-29 14:12:33 +00:00
#[cfg(test)]
mod examples {
use day35::gopher_escape_plan;
#[test]
fn example1() {
assert_eq!(
gopher_escape_plan("../../../assets/day-35_sample_1_valid.txt"),
vec![
"The gopher cannot escape.",
"The gopher can escape through the hole at (2.500000,2.500000)."
]
)
}
#[test]
fn example2() {
assert_eq!(
gopher_escape_plan("../../../assets/day-35_sample_2_valid.txt"),
vec![
"The gopher cannot escape.",
"The gopher can escape through the hole at (2.500000,2.500000)."
]
)
}
#[test]
fn example3() {
assert_eq!(
gopher_escape_plan("../../../assets/day-35_sample_3_invalid.txt"),
vec!["BAD FILE!"]
)
}
#[test]
fn example4() {
assert_eq!(
gopher_escape_plan("../../../assets/day-35_sample_4_invalid.txt"),
vec!["BAD FILE!"]
)
}
#[test]
fn example5() {
assert_eq!(
gopher_escape_plan("../../../assets/day-35_sample_5_invalid.txt"),
vec!["BAD FILE!"]
)
}
}