100-days-of-rust/Week-07/Day-43_Area-Of-A-Triangle/day43/tests/examples.rs

35 lines
586 B
Rust
Raw Normal View History

2024-09-06 07:54:25 +00:00
#[cfg(test)]
mod examples {
use day43::tri_area;
#[test]
fn example1() {
assert_eq!(tri_area(3f64, 2f64), 3f64);
}
#[test]
fn example2() {
assert_eq!(tri_area(5f64, 4f64), 10f64);
}
#[test]
fn example3() {
assert_eq!(tri_area(7f64, 4f64), 14f64);
}
#[test]
fn example4() {
assert_eq!(tri_area(10f64, 10f64), 50f64);
}
#[test]
fn example5() {
assert_eq!(tri_area(12f64, 11f64), 66f64);
}
#[test]
fn example6() {
assert_eq!(tri_area(0f64, 60f64), 0f64);
}
}