Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dousir9 committed Oct 18, 2023
1 parent 7375aee commit 7285bc1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/it/bitmap/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ fn as_slice_offset_middle() {
fn new_constant() {
let b = Bitmap::new_constant(true, 9);
let (slice, offset, length) = b.as_slice();
assert_eq!(slice, &[0b11111111, 0b1]);
assert_eq!(slice[0], 0b11111111);
assert!((slice[1] & 0b00000001) > 0);
assert_eq!(offset, 0);
assert_eq!(length, 9);
assert_eq!(b.unset_bits(), 0);

let b = Bitmap::new_constant(false, 9);
let (slice, offset, length) = b.as_slice();
assert_eq!(slice, &[0b00000000, 0b0]);
assert_eq!(slice[0], 0b00000000);
assert!((slice[1] & 0b00000001) == 0);
assert_eq!(offset, 0);
assert_eq!(length, 9);
assert_eq!(b.unset_bits(), 9);
Expand Down

0 comments on commit 7285bc1

Please sign in to comment.