Skip to content

Commit 7c0626a

Browse files
authored
Update tests2.rs
1 parent e79227d commit 7c0626a

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

exercises/tests/tests2.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
// tests2.rs
2-
//
3-
// This test has a problem with it -- make the test compile! Make the test pass!
4-
// Make the test fail!
5-
//
6-
// Execute `rustlings hint tests2` or use the `hint` watch subcommand for a
7-
// hint.
8-
9-
// I AM NOT DONE
10-
111
#[cfg(test)]
122
mod tests {
133
#[test]
144
fn you_can_assert_eq() {
15-
assert_eq!();
5+
// 1. 让测试编译并通过:assert_eq! 需要两个相等的参数
6+
// assert_eq!(42, 42);
7+
8+
// 2. 让测试编译但失败:传入两个不相等的参数(取消注释下面这行,注释上面的)
9+
assert_eq!(42, 13);
1610
}
1711
}

0 commit comments

Comments
 (0)