diff --git a/tests/histogram.rs b/tests/histogram.rs index d4e3f38..7f09798 100644 --- a/tests/histogram.rs +++ b/tests/histogram.rs @@ -565,5 +565,12 @@ fn subtract_underflow_guarded_by_per_value_count_check() { fn recorded_only_zeros() { let mut h = Histogram::::new(1).unwrap(); h += 0; - assert_eq!(h.iter_recorded().count(), 1); + // Do not simplify .collect::>().len() to .count() + // This check a bug where .count() and .collect::>().len() + // are different + assert_eq!(h.iter_recorded().collect::>().len(), 1); + assert_eq!( + h.iter_recorded().collect::>().len(), + h.iter_recorded().count() + ); }