mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 09:31:34 +11:00
add tests
This commit is contained in:
parent
8bf59e0f20
commit
c208b6528a
|
@ -22,3 +22,12 @@ impl<const N: usize> Bitarray<N> {
|
|||
self.a[index / N] = self.a[index / N] & !mask | value_mask
|
||||
}
|
||||
}
|
||||
|
||||
#[test_case]
|
||||
fn write_and_read(_gba: &mut crate::Gba) {
|
||||
let mut a: Bitarray<2> = Bitarray::new();
|
||||
assert_eq!(a.get(55).unwrap(), false, "expect unset values to be false");
|
||||
a.set(62, true);
|
||||
assert_eq!(a.get(62).unwrap(), true, "expect set value to be true");
|
||||
assert_eq!(a.get(120), None, "expect out of range to give None");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue