use crate::Float;
use crate::test_util::common::to_hex_string;
use itertools::Itertools;
pub fn exhaustive_floats_helper_helper_with_limit<I: Clone + Iterator<Item = Float>>(
limit: usize,
xs: I,
out: &[&str],
out_hex: &[&str],
) {
let xs_hex = xs.clone();
assert_eq!(
xs_hex
.take(limit)
.map(|f| {
assert!(f.is_valid());
to_hex_string(&f)
})
.collect_vec()
.as_slice(),
out_hex
);
assert_eq!(
xs.take(limit)
.map(|f| { f.to_string() })
.collect_vec()
.as_slice(),
out
);
}
pub fn exhaustive_floats_helper_helper<I: Clone + Iterator<Item = Float>>(
xs: I,
out: &[&str],
out_hex: &[&str],
) {
exhaustive_floats_helper_helper_with_limit(50, xs, out, out_hex);
}