Skip to content

Commit

Permalink
Test negative zero parsing to f32
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 14, 2021
1 parent ef823af commit b419f2e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,10 +811,15 @@ fn test_parse_negative_zero() {
"-1e-400",
"-1e-4000000000000000000000000000000000000000000000000",
] {
assert!(
from_str::<f32>(negative_zero).unwrap().is_sign_negative(),
"should have been negative: {:?}",
negative_zero,
);
assert!(
from_str::<f64>(negative_zero).unwrap().is_sign_negative(),
"should have been negative: {:?}",
negative_zero
negative_zero,
);
}
}
Expand Down

0 comments on commit b419f2e

Please sign in to comment.