Skip to content

Commit 014e4ac

Browse files
authored
Rollup merge of rust-lang#78425 - chansuke:move_nan, r=jyn514
Move f64::NAN ui tests into `library` This is a partial fix of rust-lang#76268. r? ```@matklad```
2 parents 19bd924 + 85b1fad commit 014e4ac

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

core/tests/num/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ mod bignum;
2727
mod dec2flt;
2828
mod flt2dec;
2929

30+
mod nan;
31+
3032
/// Adds the attribute to all items in the block.
3133
macro_rules! cfg_block {
3234
($(#[$attr:meta]{$($it:item)*})*) => {$($(

core/tests/num/nan.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#[test]
2+
fn test_nan() {
3+
use core::f64;
4+
let x = "NaN".to_string();
5+
assert_eq!(format!("{}", f64::NAN), x);
6+
assert_eq!(format!("{:e}", f64::NAN), x);
7+
assert_eq!(format!("{:E}", f64::NAN), x);
8+
}

0 commit comments

Comments
 (0)