From 079ed4a992df4db94d7c4b555b164cf89ab4bf1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Lecrenier?= Date: Thu, 1 Sep 2022 12:57:29 +0200 Subject: [PATCH] Add more snapshots --- milli/src/search/facet/facet_range_search.rs | 12 ++++++------ .../{0.hash.snap => excluded_0.hash.snap} | 0 .../{1.hash.snap => excluded_1.hash.snap} | 0 .../filter_range_decreasing/included_0.hash.snap | 4 ++++ .../filter_range_decreasing/included_1.hash.snap | 4 ++++ .../{0.hash.snap => excluded_0.hash.snap} | 0 .../{1.hash.snap => excluded_1.hash.snap} | 0 .../filter_range_increasing/included_0.hash.snap | 4 ++++ .../filter_range_increasing/included_1.hash.snap | 4 ++++ .../{0.hash.snap => excluded_0.hash.snap} | 0 .../{1.hash.snap => excluded_1.hash.snap} | 0 .../filter_range_pinch/included_0.hash.snap | 4 ++++ .../filter_range_pinch/included_1.hash.snap | 4 ++++ milli/src/update/facet/incremental.rs | 10 +++++----- ...evel0_delete.hash.snap => after_delete.hash.snap} | 0 .../in_place_level0_delete/before_delete.hash.snap | 4 ++++ .../after_delete.hash.snap} | 0 .../before_delete.hash.snap} | 0 18 files changed, 39 insertions(+), 11 deletions(-) rename milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/{0.hash.snap => excluded_0.hash.snap} (100%) rename milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/{1.hash.snap => excluded_1.hash.snap} (100%) create mode 100644 milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/included_0.hash.snap create mode 100644 milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/included_1.hash.snap rename milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/{0.hash.snap => excluded_0.hash.snap} (100%) rename milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/{1.hash.snap => excluded_1.hash.snap} (100%) create mode 100644 milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/included_0.hash.snap create mode 100644 milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/included_1.hash.snap rename milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/{0.hash.snap => excluded_0.hash.snap} (100%) rename milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/{1.hash.snap => excluded_1.hash.snap} (100%) create mode 100644 milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/included_0.hash.snap create mode 100644 milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/included_1.hash.snap rename milli/src/update/facet/snapshots/incremental.rs/in_place_level0_delete/{in_place_level0_delete.hash.snap => after_delete.hash.snap} (100%) create mode 100644 milli/src/update/facet/snapshots/incremental.rs/in_place_level0_delete/before_delete.hash.snap rename milli/src/update/facet/snapshots/incremental.rs/{shuffle_merge_string/2.hash.snap => shuffle_merge_string_and_delete/after_delete.hash.snap} (100%) rename milli/src/update/facet/snapshots/incremental.rs/{shuffle_merge_string/1.hash.snap => shuffle_merge_string_and_delete/before_delete.hash.snap} (100%) diff --git a/milli/src/search/facet/facet_range_search.rs b/milli/src/search/facet/facet_range_search.rs index 20ad23a37..039cd5c8d 100644 --- a/milli/src/search/facet/facet_range_search.rs +++ b/milli/src/search/facet/facet_range_search.rs @@ -318,7 +318,7 @@ mod tests { .unwrap(); results.push_str(&format!("{}\n", display_bitmap(&docids))); } - milli_snap!(results, i); + milli_snap!(results, format!("included_{i}")); let mut results = String::new(); for i in 0..=255 { let i = i as f64; @@ -334,7 +334,7 @@ mod tests { .unwrap(); results.push_str(&format!("{}\n", display_bitmap(&docids))); } - milli_snap!(results, i); + milli_snap!(results, format!("excluded_{i}")); txn.commit().unwrap(); } } @@ -361,7 +361,7 @@ mod tests { results.push_str(&format!("{}\n", display_bitmap(&docids))); } - milli_snap!(results, i); + milli_snap!(results, format!("included_{i}")); let mut results = String::new(); @@ -380,7 +380,7 @@ mod tests { results.push_str(&format!("{}\n", display_bitmap(&docids))); } - milli_snap!(results, i); + milli_snap!(results, format!("excluded_{i}")); txn.commit().unwrap(); } @@ -408,7 +408,7 @@ mod tests { results.push_str(&format!("{}\n", display_bitmap(&docids))); } - milli_snap!(results, i); + milli_snap!(results, format!("included_{i}")); let mut results = String::new(); @@ -427,7 +427,7 @@ mod tests { results.push_str(&format!("{}\n", display_bitmap(&docids))); } - milli_snap!(results, i); + milli_snap!(results, format!("excluded_{i}")); txn.commit().unwrap(); } diff --git a/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/0.hash.snap b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/excluded_0.hash.snap similarity index 100% rename from milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/0.hash.snap rename to milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/excluded_0.hash.snap diff --git a/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/1.hash.snap b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/excluded_1.hash.snap similarity index 100% rename from milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/1.hash.snap rename to milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/excluded_1.hash.snap diff --git a/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/included_0.hash.snap b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/included_0.hash.snap new file mode 100644 index 000000000..be0b06ded --- /dev/null +++ b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/included_0.hash.snap @@ -0,0 +1,4 @@ +--- +source: milli/src/search/facet/facet_range_search.rs +--- +57d35cfa419a19a1a1f8d7c8ef096e0f diff --git a/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/included_1.hash.snap b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/included_1.hash.snap new file mode 100644 index 000000000..93fe17b0c --- /dev/null +++ b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_decreasing/included_1.hash.snap @@ -0,0 +1,4 @@ +--- +source: milli/src/search/facet/facet_range_search.rs +--- +3dbe0547b42759795e9b16989df72cee diff --git a/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/0.hash.snap b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/excluded_0.hash.snap similarity index 100% rename from milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/0.hash.snap rename to milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/excluded_0.hash.snap diff --git a/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/1.hash.snap b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/excluded_1.hash.snap similarity index 100% rename from milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/1.hash.snap rename to milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/excluded_1.hash.snap diff --git a/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/included_0.hash.snap b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/included_0.hash.snap new file mode 100644 index 000000000..fa7242056 --- /dev/null +++ b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/included_0.hash.snap @@ -0,0 +1,4 @@ +--- +source: milli/src/search/facet/facet_range_search.rs +--- +ca59f20e043a4d52c49e15b10adf96bb diff --git a/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/included_1.hash.snap b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/included_1.hash.snap new file mode 100644 index 000000000..a7611d8c1 --- /dev/null +++ b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_increasing/included_1.hash.snap @@ -0,0 +1,4 @@ +--- +source: milli/src/search/facet/facet_range_search.rs +--- +cb69e0fe10fb299bafe77514204379cb diff --git a/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/0.hash.snap b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/excluded_0.hash.snap similarity index 100% rename from milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/0.hash.snap rename to milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/excluded_0.hash.snap diff --git a/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/1.hash.snap b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/excluded_1.hash.snap similarity index 100% rename from milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/1.hash.snap rename to milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/excluded_1.hash.snap diff --git a/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/included_0.hash.snap b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/included_0.hash.snap new file mode 100644 index 000000000..db8a314b0 --- /dev/null +++ b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/included_0.hash.snap @@ -0,0 +1,4 @@ +--- +source: milli/src/search/facet/facet_range_search.rs +--- +b976551ceff412bfb2ec9bfbda320bbb diff --git a/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/included_1.hash.snap b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/included_1.hash.snap new file mode 100644 index 000000000..2b82e07e8 --- /dev/null +++ b/milli/src/search/facet/snapshots/facet_range_search.rs/filter_range_pinch/included_1.hash.snap @@ -0,0 +1,4 @@ +--- +source: milli/src/search/facet/facet_range_search.rs +--- +7620ca1a96882c7147d3fd996570f9b3 diff --git a/milli/src/update/facet/incremental.rs b/milli/src/update/facet/incremental.rs index 3493db0f7..e32a6baf1 100644 --- a/milli/src/update/facet/incremental.rs +++ b/milli/src/update/facet/incremental.rs @@ -853,7 +853,7 @@ mod tests { txn.commit().unwrap(); } verify_structure_validity(&index, 0); - milli_snap!(format!("{index}")); + milli_snap!(format!("{index}"), "before_delete"); for &key in keys.iter() { verify_structure_validity(&index, 0); @@ -862,11 +862,11 @@ mod tests { txn.commit().unwrap(); } verify_structure_validity(&index, 0); - milli_snap!(format!("{index}")); + milli_snap!(format!("{index}"), "after_delete"); } #[test] - fn shuffle_merge_string() { + fn shuffle_merge_string_and_delete() { let index = FacetIndex::::new(4, 8); let mut keys = (1000..1064).into_iter().collect::>(); @@ -883,7 +883,7 @@ mod tests { txn.commit().unwrap(); } verify_structure_validity(&index, 0); - milli_snap!(format!("{index}"), 1); + milli_snap!(format!("{index}"), "before_delete"); for &key in keys.iter() { verify_structure_validity(&index, 0); @@ -892,7 +892,7 @@ mod tests { txn.commit().unwrap(); } verify_structure_validity(&index, 0); - milli_snap!(format!("{index}"), 2); + milli_snap!(format!("{index}"), "after_delete"); } // fuzz tests diff --git a/milli/src/update/facet/snapshots/incremental.rs/in_place_level0_delete/in_place_level0_delete.hash.snap b/milli/src/update/facet/snapshots/incremental.rs/in_place_level0_delete/after_delete.hash.snap similarity index 100% rename from milli/src/update/facet/snapshots/incremental.rs/in_place_level0_delete/in_place_level0_delete.hash.snap rename to milli/src/update/facet/snapshots/incremental.rs/in_place_level0_delete/after_delete.hash.snap diff --git a/milli/src/update/facet/snapshots/incremental.rs/in_place_level0_delete/before_delete.hash.snap b/milli/src/update/facet/snapshots/incremental.rs/in_place_level0_delete/before_delete.hash.snap new file mode 100644 index 000000000..c57ca72eb --- /dev/null +++ b/milli/src/update/facet/snapshots/incremental.rs/in_place_level0_delete/before_delete.hash.snap @@ -0,0 +1,4 @@ +--- +source: milli/src/update/facet/incremental.rs +--- +b17b2c4ec87a778aae07854c96c08b48 diff --git a/milli/src/update/facet/snapshots/incremental.rs/shuffle_merge_string/2.hash.snap b/milli/src/update/facet/snapshots/incremental.rs/shuffle_merge_string_and_delete/after_delete.hash.snap similarity index 100% rename from milli/src/update/facet/snapshots/incremental.rs/shuffle_merge_string/2.hash.snap rename to milli/src/update/facet/snapshots/incremental.rs/shuffle_merge_string_and_delete/after_delete.hash.snap diff --git a/milli/src/update/facet/snapshots/incremental.rs/shuffle_merge_string/1.hash.snap b/milli/src/update/facet/snapshots/incremental.rs/shuffle_merge_string_and_delete/before_delete.hash.snap similarity index 100% rename from milli/src/update/facet/snapshots/incremental.rs/shuffle_merge_string/1.hash.snap rename to milli/src/update/facet/snapshots/incremental.rs/shuffle_merge_string_and_delete/before_delete.hash.snap