Fix some machine epsilon warnings

This commit is contained in:
JT 2021-11-02 19:37:53 +13:00
parent 7b2116dc29
commit 19301751ee
2 changed files with 2 additions and 2 deletions

View file

@ -141,7 +141,7 @@ mod tests {
match (&lhs.expr, &rhs.expr) {
(Expr::Bool(a), Expr::Bool(b)) => assert_eq!(a, b),
(Expr::Int(a), Expr::Int(b)) => assert_eq!(a, b),
(Expr::Float(a), Expr::Float(b)) => assert_eq!(a, b),
(Expr::Float(a), Expr::Float(b)) => assert!((a - b).abs() < f64::EPSILON),
(Expr::String(a), Expr::String(b)) => assert_eq!(a, b),
_ => panic!("not matching values"),
}

View file

@ -228,7 +228,7 @@ mod tests {
match (&lhs.expr, &rhs.expr) {
(Expr::Bool(a), Expr::Bool(b)) => assert_eq!(a, b),
(Expr::Int(a), Expr::Int(b)) => assert_eq!(a, b),
(Expr::Float(a), Expr::Float(b)) => assert_eq!(a, b),
(Expr::Float(a), Expr::Float(b)) => assert!((a - b).abs() < f64::EPSILON),
(Expr::String(a), Expr::String(b)) => assert_eq!(a, b),
_ => panic!("not matching values"),
}