From faca269488948425e1e624a3c2abbad6fb694731 Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Thu, 11 May 2017 12:10:27 +0100 Subject: [PATCH] clean tests/ui/float.rs Cleaning the empty lines for clarity. --- tests/ui/float_cmp.rs | 27 ------------------- tests/ui/float_cmp.stderr | 56 +++++++++++++++++++-------------------- 2 files changed, 28 insertions(+), 55 deletions(-) diff --git a/tests/ui/float_cmp.rs b/tests/ui/float_cmp.rs index 024dd9c242c..d6a74193ae3 100644 --- a/tests/ui/float_cmp.rs +++ b/tests/ui/float_cmp.rs @@ -41,48 +41,21 @@ fn main() { ZERO + ZERO != 1.0; //no error, comparison with zero is ok ONE == 1f32; - - - ONE == 1.0 + 0.0; - - - - ONE + ONE == ZERO + ONE + ONE; - - - - ONE != 2.0; - - - ONE != 0.0; // no error, comparison with zero is ok twice(ONE) != ONE; - - - ONE as f64 != 2.0; - - - ONE as f64 != 0.0; // no error, comparison with zero is ok let x : f64 = 1.0; x == 1.0; - - - x != 0f64; // no error, comparison with zero is ok twice(x) != twice(ONE as f64); - - - - x < 0.0; // no errors, lower or greater comparisons need no fuzzyness x > 0.0; x <= 0.0; diff --git a/tests/ui/float_cmp.stderr b/tests/ui/float_cmp.stderr index 1eff9cdecc4..082990334d1 100644 --- a/tests/ui/float_cmp.stderr +++ b/tests/ui/float_cmp.stderr @@ -16,87 +16,87 @@ note: std::f32::EPSILON and std::f64::EPSILON are available. | ^^^^^^^^^^^ error: strict comparison of f32 or f64 - --> $DIR/float_cmp.rs:47:5 + --> $DIR/float_cmp.rs:44:5 | -47 | ONE == 1.0 + 0.0; +44 | ONE == 1.0 + 0.0; | ^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(ONE - (1.0 + 0.0)).abs() < error` | note: std::f32::EPSILON and std::f64::EPSILON are available. - --> $DIR/float_cmp.rs:47:5 + --> $DIR/float_cmp.rs:44:5 | -47 | ONE == 1.0 + 0.0; +44 | ONE == 1.0 + 0.0; | ^^^^^^^^^^^^^^^^ error: strict comparison of f32 or f64 - --> $DIR/float_cmp.rs:52:5 + --> $DIR/float_cmp.rs:45:5 | -52 | ONE + ONE == ZERO + ONE + ONE; +45 | ONE + ONE == ZERO + ONE + ONE; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(ONE + ONE - (ZERO + ONE + ONE)).abs() < error` | note: std::f32::EPSILON and std::f64::EPSILON are available. - --> $DIR/float_cmp.rs:52:5 + --> $DIR/float_cmp.rs:45:5 | -52 | ONE + ONE == ZERO + ONE + ONE; +45 | ONE + ONE == ZERO + ONE + ONE; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: strict comparison of f32 or f64 - --> $DIR/float_cmp.rs:57:5 + --> $DIR/float_cmp.rs:46:5 | -57 | ONE != 2.0; +46 | ONE != 2.0; | ^^^^^^^^^^ help: consider comparing them within some error `(ONE - 2.0).abs() < error` | note: std::f32::EPSILON and std::f64::EPSILON are available. - --> $DIR/float_cmp.rs:57:5 + --> $DIR/float_cmp.rs:46:5 | -57 | ONE != 2.0; +46 | ONE != 2.0; | ^^^^^^^^^^ error: strict comparison of f32 or f64 - --> $DIR/float_cmp.rs:62:5 + --> $DIR/float_cmp.rs:48:5 | -62 | twice(ONE) != ONE; +48 | twice(ONE) != ONE; | ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(twice(ONE) - ONE).abs() < error` | note: std::f32::EPSILON and std::f64::EPSILON are available. - --> $DIR/float_cmp.rs:62:5 + --> $DIR/float_cmp.rs:48:5 | -62 | twice(ONE) != ONE; +48 | twice(ONE) != ONE; | ^^^^^^^^^^^^^^^^^ error: strict comparison of f32 or f64 - --> $DIR/float_cmp.rs:66:5 + --> $DIR/float_cmp.rs:49:5 | -66 | ONE as f64 != 2.0; +49 | ONE as f64 != 2.0; | ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(ONE as f64 - 2.0).abs() < error` | note: std::f32::EPSILON and std::f64::EPSILON are available. - --> $DIR/float_cmp.rs:66:5 + --> $DIR/float_cmp.rs:49:5 | -66 | ONE as f64 != 2.0; +49 | ONE as f64 != 2.0; | ^^^^^^^^^^^^^^^^^ error: strict comparison of f32 or f64 - --> $DIR/float_cmp.rs:74:5 + --> $DIR/float_cmp.rs:54:5 | -74 | x == 1.0; +54 | x == 1.0; | ^^^^^^^^ help: consider comparing them within some error `(x - 1.0).abs() < error` | note: std::f32::EPSILON and std::f64::EPSILON are available. - --> $DIR/float_cmp.rs:74:5 + --> $DIR/float_cmp.rs:54:5 | -74 | x == 1.0; +54 | x == 1.0; | ^^^^^^^^ error: strict comparison of f32 or f64 - --> $DIR/float_cmp.rs:80:5 + --> $DIR/float_cmp.rs:57:5 | -80 | twice(x) != twice(ONE as f64); +57 | twice(x) != twice(ONE as f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error `(twice(x) - twice(ONE as f64)).abs() < error` | note: std::f32::EPSILON and std::f64::EPSILON are available. - --> $DIR/float_cmp.rs:80:5 + --> $DIR/float_cmp.rs:57:5 | -80 | twice(x) != twice(ONE as f64); +57 | twice(x) != twice(ONE as f64); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 8 previous errors