Update tests with Range parameter to BTreeMap::extract_if etc.

This commit is contained in:
Sidney Cammeresi 2025-05-07 17:05:44 -07:00
parent 51d247c2cf
commit 1ae96fcd79
7 changed files with 56 additions and 46 deletions

View file

@ -14,14 +14,14 @@ fn main() {
map.insert("c", ());
{
let mut it = map.extract_if(|_, _| true);
let mut it = map.extract_if(.., |_, _| true);
catch_unwind(AssertUnwindSafe(|| while it.next().is_some() {})).unwrap_err();
let result = catch_unwind(AssertUnwindSafe(|| it.next()));
assert!(matches!(result, Ok(None)));
}
{
let mut it = map.extract_if(|_, _| true);
let mut it = map.extract_if(.., |_, _| true);
catch_unwind(AssertUnwindSafe(|| while let Some(_) = it.next() {})).unwrap_err();
let result = catch_unwind(AssertUnwindSafe(|| it.next()));
assert!(matches!(result, Ok(None)));