wiggle: use bitflags to generate flags
more consistient with the rest of the ecosystem.
This commit is contained in:
@@ -103,11 +103,11 @@ proptest! {
|
||||
#[test]
|
||||
fn flags_fmt() {
|
||||
let empty = format!("{}", types::CarConfig::empty());
|
||||
assert_eq!(empty, "empty (0x0)");
|
||||
assert_eq!(empty, "CarConfig((empty) (0x0))");
|
||||
let one_flag = format!("{}", types::CarConfig::AWD);
|
||||
assert_eq!(one_flag, "awd (0x2)");
|
||||
assert_eq!(one_flag, "CarConfig(AWD (0x2))");
|
||||
let two_flags = format!("{}", types::CarConfig::AUTOMATIC | types::CarConfig::SUV);
|
||||
assert_eq!(two_flags, "automatic|suv (0x5)");
|
||||
assert_eq!(two_flags, "CarConfig(AUTOMATIC | SUV (0x5))");
|
||||
let all = format!("{}", types::CarConfig::all());
|
||||
assert_eq!(all, "automatic|awd|suv (0x7)");
|
||||
assert_eq!(all, "CarConfig(AUTOMATIC | AWD | SUV (0x7))");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user