ddr::ssq::Row: Test Into<Vec<bool>>
This commit is contained in:
parent
087c190e63
commit
e70d9f6cea
|
@ -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;
|
||||||
|
|
Reference in a new issue