From 5855fb7b79d755b49152a334d18fa6b1efae7bf4 Mon Sep 17 00:00:00 2001 From: chansuke Date: Tue, 27 Oct 2020 09:29:57 +0900 Subject: [PATCH 1/3] Move f64::NAN ui tests into `library` --- library/core/tests/num/nan.rs | 8 ++++++++ src/test/ui/format-nan.rs | 9 --------- 2 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 library/core/tests/num/nan.rs delete mode 100644 src/test/ui/format-nan.rs diff --git a/library/core/tests/num/nan.rs b/library/core/tests/num/nan.rs new file mode 100644 index 00000000000..6d64f93cfa4 --- /dev/null +++ b/library/core/tests/num/nan.rs @@ -0,0 +1,8 @@ +#[test] +fn test_nan() { + use core::f64; + let x = "NaN".to_string(); + assert_eq!(format!("{}", f64::NAN), x); + assert_eq!(format!("{:e}", f64::NAN), x); + assert_eq!(format!("{:E}", f64::NAN), x); +} diff --git a/src/test/ui/format-nan.rs b/src/test/ui/format-nan.rs deleted file mode 100644 index e4a134fa2fb..00000000000 --- a/src/test/ui/format-nan.rs +++ /dev/null @@ -1,9 +0,0 @@ -// run-pass - -pub fn main() { - use std::f64; - let x = "NaN".to_string(); - assert_eq!(format!("{}", f64::NAN), x); - assert_eq!(format!("{:e}", f64::NAN), x); - assert_eq!(format!("{:E}", f64::NAN), x); -} From 97d5a1be3fa720af94467eb65de4f80eb1920539 Mon Sep 17 00:00:00 2001 From: chansuke Date: Thu, 5 Nov 2020 08:40:04 +0900 Subject: [PATCH 2/3] Fix format --- library/core/tests/num/nan.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/core/tests/num/nan.rs b/library/core/tests/num/nan.rs index 6d64f93cfa4..011ffa790be 100644 --- a/library/core/tests/num/nan.rs +++ b/library/core/tests/num/nan.rs @@ -1,8 +1,8 @@ #[test] fn test_nan() { - use core::f64; - let x = "NaN".to_string(); - assert_eq!(format!("{}", f64::NAN), x); - assert_eq!(format!("{:e}", f64::NAN), x); - assert_eq!(format!("{:E}", f64::NAN), x); + use core::f64; + let x = "NaN".to_string(); + assert_eq!(format!("{}", f64::NAN), x); + assert_eq!(format!("{:e}", f64::NAN), x); + assert_eq!(format!("{:E}", f64::NAN), x); } From f9b139f9c4d0abc95dff1b103db0e0239ef3db8b Mon Sep 17 00:00:00 2001 From: chansuke Date: Thu, 5 Nov 2020 12:57:18 +0900 Subject: [PATCH 3/3] Add `mod nan` for test --- library/core/tests/num/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/core/tests/num/mod.rs b/library/core/tests/num/mod.rs index 378c8af344b..190528fd445 100644 --- a/library/core/tests/num/mod.rs +++ b/library/core/tests/num/mod.rs @@ -27,6 +27,8 @@ mod dec2flt; mod flt2dec; +mod nan; + /// Adds the attribute to all items in the block. macro_rules! cfg_block { ($(#[$attr:meta]{$($it:item)*})*) => {$($(