Update bool_bitfield tests

This commit is contained in:
Paul Hauner 2018-07-12 17:50:02 +10:00
parent acb5a17748
commit eb2ac990d7

View File

@ -119,14 +119,13 @@ mod tests {
#[test] #[test]
fn test_bitfield_get() { fn test_bitfield_get() {
let mut b = BooleanBitfield::new();
let test_nums = vec![0, 8, 15, 42, 1337]; let test_nums = vec![0, 8, 15, 42, 1337];
for i in test_nums { for i in test_nums {
b = BooleanBitfield::new(); let mut b = BooleanBitfield::new();
assert_eq!(b.get_bit(&0), false); assert_eq!(b.get_bit(&i), false);
b.set_bit(&0, &true); b.set_bit(&i, &true);
assert_eq!(b.get_bit(&0), true); assert_eq!(b.get_bit(&i), true);
b.set_bit(&0, &true); b.set_bit(&i, &true);
} }
} }