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