Add test code to create roaring bitmap

This commit is contained in:
David Tolnay 2022-05-16 14:26:28 -07:00
parent 21024e2c71
commit 3a2eb6c64b
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 22 additions and 0 deletions

View File

@ -7,6 +7,7 @@ publish = false
[dev-dependencies]
fst = "0.4"
roaring = "0.9"
ucd-trie = { version = "0.1", default-features = false }
[workspace]

21
tests/roaring/mod.rs Normal file
View File

@ -0,0 +1,21 @@
use roaring::RoaringBitmap;
pub fn xid_start_bitmap() -> RoaringBitmap {
let mut bitmap = RoaringBitmap::new();
for ch in '\0'..=char::MAX {
if unicode_ident::is_xid_start(ch) {
bitmap.insert(ch as u32);
}
}
bitmap
}
pub fn xid_continue_bitmap() -> RoaringBitmap {
let mut bitmap = RoaringBitmap::new();
for ch in '\0'..=char::MAX {
if unicode_ident::is_xid_continue(ch) {
bitmap.insert(ch as u32);
}
}
bitmap
}