Skip to content

Commit

Permalink
✅ Add bitmap test for lsb
Browse files Browse the repository at this point in the history
  • Loading branch information
bal7hazar committed Sep 10, 2024
1 parent 87001b1 commit 209fd45
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/map/src/helpers/bitmap.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,17 @@ mod tests {
let bit = Bitmap::unset(0b1001010, 0);
assert_eq!(bit, 0b1001010);
}

#[test]
fn test_bitmap_least_significant_bit_null() {
let msb = Bitmap::least_significant_bit(0);
assert!(msb == 0, "Bitmap: least significant bit");
}

#[test]
fn test_bitmap_least_significant_bit() {
let bitmap: felt252 = 1234; // 10011010010
let msb = Bitmap::least_significant_bit(bitmap);
assert!(msb == 1, "Bitmap: least significant bit");
}
}

0 comments on commit 209fd45

Please sign in to comment.