mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-11 21:29:18 +00:00
feat: complete tests
This commit is contained in:
parent
9a5a7a26d9
commit
ace288f89f
@ -7,12 +7,10 @@
|
|||||||
// pass! Make the test fail!
|
// pass! Make the test fail!
|
||||||
// Execute `rustlings hint tests1` or use the `hint` watch subcommand for a hint.
|
// Execute `rustlings hint tests1` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn you_can_assert() {
|
fn you_can_assert() {
|
||||||
assert!();
|
assert!(1 == 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,12 +3,10 @@
|
|||||||
// pass! Make the test fail!
|
// pass! Make the test fail!
|
||||||
// Execute `rustlings hint tests2` or use the `hint` watch subcommand for a hint.
|
// Execute `rustlings hint tests2` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn you_can_assert_eq() {
|
fn you_can_assert_eq() {
|
||||||
assert_eq!();
|
assert_eq!("", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,8 +4,6 @@
|
|||||||
// we expect to get when we call `is_even(5)`.
|
// we expect to get when we call `is_even(5)`.
|
||||||
// Execute `rustlings hint tests3` or use the `hint` watch subcommand for a hint.
|
// Execute `rustlings hint tests3` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
pub fn is_even(num: i32) -> bool {
|
pub fn is_even(num: i32) -> bool {
|
||||||
num % 2 == 0
|
num % 2 == 0
|
||||||
}
|
}
|
||||||
@ -16,11 +14,11 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn is_true_when_even() {
|
fn is_true_when_even() {
|
||||||
assert!();
|
assert!(is_even(4));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn is_false_when_odd() {
|
fn is_false_when_odd() {
|
||||||
assert!();
|
assert!(!is_even(5));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user