rustlings/exercises/tests/tests3.rs

32 lines
563 B
Rust
Raw Normal View History

2018-02-22 13:09:53 +07:00
// tests3.rs
2015-09-21 04:31:41 +06:00
// This test isn't testing our function -- make it do that in such a way that
// the test passes, but just replace the ???
// Execute `rustlings hint tests3` for hints :)
2015-09-21 04:31:41 +06:00
// I AM NOT DONE
// Don't modify this function
2015-09-21 04:31:41 +06:00
pub fn is_even(num: i32) -> bool {
num % 2 == 0
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn is_true_when_even() {
assert!(???);
2015-09-21 04:31:41 +06:00
}
#[test]
fn is_false_when_odd() {
assert_eq!(false, ???);
}
#[test]
fn is_false_when_odd2() {
assert_ne!(true, ???);
}
2015-09-21 04:31:41 +06:00
}