2023-05-29 13:39:08 -04:00
|
|
|
// 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
|
|
|
|
2024-04-17 16:46:21 -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!();
|
|
|
|
}
|
|
|
|
}
|