From 34936eeb2ce38fe4adda922a13a31af450873c3b Mon Sep 17 00:00:00 2001 From: ripytide Date: Thu, 20 Apr 2023 20:48:07 +0100 Subject: [PATCH] before the finiteness revelation --- src/range_bounds_map.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/range_bounds_map.rs b/src/range_bounds_map.rs index ad1e23d..599f12a 100644 --- a/src/range_bounds_map.rs +++ b/src/range_bounds_map.rs @@ -797,7 +797,7 @@ where let (trimmed_start_gap, trimmed_end_gap) = match (start_gap, end_gap) { (Some(mut start_gap), Some(mut end_gap)) => { - if start_gap.start() == end_gap.end() { + if start_gap.start() == end_gap.start() { //it's the same gap if let DiscreteBoundOrd::Included(outer_range_start) = outer_range.start() { start_gap.start = DiscreteBound::Included(outer_range_start); @@ -1956,7 +1956,6 @@ mod tests { #[test] fn gaps_tests() { - eprintln!("hererererererer"); assert_gaps(basic(), ii(50, 60), [ii(50, 60)]); assert_gaps(basic(), iu(50), [iu(50)]); assert_gaps(basic(), ee(3, 16), [ei(4, 5), ee(7, 14)]); @@ -1973,6 +1972,13 @@ mod tests { ii(i8::MIN, i8::MAX), [ei(4, 5), ee(7, 14), ii(16, i8::MAX)], ); + assert_eq!( + RangeBoundsMap::from_slice_strict([(ii(i8::MIN, i8::MAX), false)]) + .unwrap() + .gaps(uu()) + .collect::>(), + [ui(i8::MIN), iu(i8::MAX)] + ); } fn assert_gaps( map: RangeBoundsMap, bool>,