test: Don't compare floats for strict equality
parent
266dffea86
commit
31ead36fc0
|
@ -1913,6 +1913,7 @@ dependencies = [
|
|||
"rand_seeder",
|
||||
"serde",
|
||||
"snafu",
|
||||
"test_helpers",
|
||||
"tokio",
|
||||
"toml",
|
||||
"tracing",
|
||||
|
|
|
@ -31,6 +31,7 @@ uuid = { version = "0.8.1", default_features = false }
|
|||
|
||||
[dev-dependencies]
|
||||
criterion = "0.3.3"
|
||||
test_helpers = { path = "../test_helpers" }
|
||||
|
||||
[[bench]]
|
||||
name = "point_generation"
|
||||
|
|
|
@ -406,6 +406,7 @@ fn field_spec_to_generator<T: DataGenRng>(
|
|||
mod test {
|
||||
use super::*;
|
||||
use crate::{DynamicRng, ZeroRng, TEST_SEED};
|
||||
use test_helpers::approximately_equal;
|
||||
|
||||
type Error = Box<dyn std::error::Error>;
|
||||
type Result<T = (), E = Error> = std::result::Result<T, E>;
|
||||
|
@ -566,7 +567,7 @@ mod test {
|
|||
|
||||
// All the values generated will always be the same known value.
|
||||
assert!(
|
||||
f64_fields.iter().all(|f| *f == start_and_end),
|
||||
f64_fields.iter().all(|f| approximately_equal(*f, start_and_end)),
|
||||
"{:?}",
|
||||
f64_fields
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue