rustlings/exercises/17_tests/tests1.rs

24 lines
467 B
Rust
Raw Normal View History

// Tests are important to ensure that your code does what you think it should
2024-06-27 10:29:03 -04:00
// do.
fn is_even(n: i64) -> bool {
n % 2 == 0
}
2015-09-20 18:31:41 -04:00
fn main() {
// You can optionally experiment here.
}
2015-09-20 18:31:41 -04:00
#[cfg(test)]
mod tests {
2024-06-27 10:29:03 -04:00
// TODO: Import `is_even`. You can use a wildcard to import everything in
// the outer module.
2015-09-20 18:31:41 -04:00
#[test]
fn you_can_assert() {
2024-06-27 10:29:03 -04:00
// TODO: Test the function `is_even` with some values.
assert!();
2015-09-20 18:31:41 -04:00
assert!();
}
}