diff --git a/crates/nu-plugin/src/plugin_call.rs b/crates/nu-plugin/src/plugin_call.rs index 7e359615fa..40c6c295e1 100644 --- a/crates/nu-plugin/src/plugin_call.rs +++ b/crates/nu-plugin/src/plugin_call.rs @@ -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"), } diff --git a/crates/nu-plugin/src/serializers/call.rs b/crates/nu-plugin/src/serializers/call.rs index 305b29e850..ab7492c4fa 100644 --- a/crates/nu-plugin/src/serializers/call.rs +++ b/crates/nu-plugin/src/serializers/call.rs @@ -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"), }