35 lines
586 B
Rust
35 lines
586 B
Rust
|
#[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);
|
||
|
}
|
||
|
}
|