Skip to content

Commit

Permalink
Add test of negative NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 25, 2023
1 parent b9b01a1 commit e6f97e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/d2s_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ fn test_basic() {
check!(-0.0);
check!(1.0);
check!(-1.0);
assert_eq!(pretty(f64::NAN), "NaN");
assert_eq!(pretty(f64::NAN.copysign(1.0)), "NaN");
assert_eq!(pretty(f64::NAN.copysign(-1.0)), "NaN");
assert_eq!(pretty(f64::INFINITY), "inf");
assert_eq!(pretty(f64::NEG_INFINITY), "-inf");
}
Expand Down
3 changes: 2 additions & 1 deletion tests/f2s_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ fn test_basic() {
check!(-0.0);
check!(1.0);
check!(-1.0);
assert_eq!(pretty(f32::NAN), "NaN");
assert_eq!(pretty(f32::NAN.copysign(1.0)), "NaN");
assert_eq!(pretty(f32::NAN.copysign(-1.0)), "NaN");
assert_eq!(pretty(f32::INFINITY), "inf");
assert_eq!(pretty(f32::NEG_INFINITY), "-inf");
}
Expand Down

0 comments on commit e6f97e0

Please sign in to comment.