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