Rollup merge of #32761 - tshepang:assert, r=steveklabnik
avoid "==" in assert! when one of the values is a bool Is suspect this is something of an idiom
This commit is contained in:
commit
3531a1a0da
5 changed files with 12 additions and 12 deletions
|
|
@ -26,12 +26,12 @@ impl Foo for LocalOverride {
|
|||
}
|
||||
|
||||
fn test_foo() {
|
||||
assert!(0i8.foo() == false);
|
||||
assert!(0i32.foo() == false);
|
||||
assert!(0i64.foo() == true);
|
||||
assert!(!0i8.foo());
|
||||
assert!(!0i32.foo());
|
||||
assert!(0i64.foo());
|
||||
|
||||
assert!(LocalDefault.foo() == false);
|
||||
assert!(LocalOverride.foo() == true);
|
||||
assert!(!LocalDefault.foo());
|
||||
assert!(LocalOverride.foo());
|
||||
}
|
||||
|
||||
fn test_bar() {
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ impl Foo for i64 {
|
|||
}
|
||||
|
||||
fn test_foo() {
|
||||
assert!(0i8.foo() == false);
|
||||
assert!(0i32.foo() == false);
|
||||
assert!(0i64.foo() == true);
|
||||
assert!(!0i8.foo());
|
||||
assert!(!0i32.foo());
|
||||
assert!(0i64.foo());
|
||||
}
|
||||
|
||||
// Next, test mixture of explicit `default` and provided methods:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue