diff --git a/exercises/conversions/using_as.rs b/exercises/conversions/using_as.rs index 922abae..b3ddcc2 100644 --- a/exercises/conversions/using_as.rs +++ b/exercises/conversions/using_as.rs @@ -3,6 +3,7 @@ // It also helps with renaming imports. // // The goal is to make sure that the division does not fail to compile +// and returns the proper type. // I AM NOT DONE @@ -17,3 +18,13 @@ fn main() { let values = [3.5, 0.3, 13.0, 11.7]; println!("{}", average(&values)); } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn returns_proper_type_and_value() { + assert_eq!(average(&[3.5, 0.3, 13.0, 11.7]), 7.125); + } +}