Improve test

This commit is contained in:
Clément Renault 2024-11-19 16:18:27 +01:00
parent fe04e51a49
commit 5f8a82d6f5
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -1698,6 +1698,8 @@ mod tests {
let colour_id = index.fields_ids_map(&rtxn).unwrap().id("colour").unwrap(); let colour_id = index.fields_ids_map(&rtxn).unwrap().id("colour").unwrap();
let colour_green_id = index.fields_ids_map(&rtxn).unwrap().id("colour.green").unwrap(); let colour_green_id = index.fields_ids_map(&rtxn).unwrap().id("colour.green").unwrap();
let colour_green_blue_id =
index.fields_ids_map(&rtxn).unwrap().id("colour.green.blue").unwrap();
let bitmap_colour = let bitmap_colour =
index.facet_id_exists_docids.get(&rtxn, &colour_id).unwrap().unwrap(); index.facet_id_exists_docids.get(&rtxn, &colour_id).unwrap().unwrap();
@ -1706,6 +1708,10 @@ mod tests {
let bitmap_colour_green = let bitmap_colour_green =
index.facet_id_exists_docids.get(&rtxn, &colour_green_id).unwrap().unwrap(); index.facet_id_exists_docids.get(&rtxn, &colour_green_id).unwrap().unwrap();
assert_eq!(bitmap_colour_green.into_iter().collect::<Vec<_>>(), vec![6, 7]); assert_eq!(bitmap_colour_green.into_iter().collect::<Vec<_>>(), vec![6, 7]);
let bitmap_colour_blue =
index.facet_id_exists_docids.get(&rtxn, &colour_green_blue_id).unwrap().unwrap();
assert_eq!(bitmap_colour_blue.into_iter().collect::<Vec<_>>(), vec![7]);
}; };
let faceted_fields = hashset!(S("colour")); let faceted_fields = hashset!(S("colour"));