Add quiz3 solution
This commit is contained in:
parent
fa6f013a27
commit
fed35d4a68
|
@ -7,8 +7,6 @@
|
|||
// we expect to get when we call `times_two` with a negative number.
|
||||
// No hints, you can do this :)
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
pub fn times_two(num: i32) -> i32 {
|
||||
num * 2
|
||||
}
|
||||
|
@ -19,11 +17,11 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn returns_twice_of_positive_numbers() {
|
||||
assert_eq!(times_two(4), ???);
|
||||
assert_eq!(times_two(4), 8);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn returns_twice_of_negative_numbers() {
|
||||
// TODO write an assert for `times_two(-4)`
|
||||
assert_eq!(times_two(-4), -8);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue