ddr::ssq::Row: Test Into<Vec<bool>>

This commit is contained in:
Simon Bruder 2020-07-23 13:10:39 +02:00
parent 087c190e63
commit e70d9f6cea
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F

View file

@ -466,6 +466,17 @@ mod tests {
} }
} }
#[test]
fn test_row_into_vec() {
let single: Vec<bool> = Row::new(0b0010, 1).unwrap().into();
let double: Vec<bool> = Row::new(0b01000000, 2).unwrap().into();
assert_eq!(single, vec![false, true, false, false]);
assert_eq!(
double,
vec![false, false, false, false, false, false, true, false]
);
}
#[quickcheck] #[quickcheck]
fn test_row_intersects_itself(columns: u8, players: bool) -> bool { fn test_row_intersects_itself(columns: u8, players: bool) -> bool {
let players = u8::from(players) + 1; let players = u8::from(players) + 1;