Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Add test of NaN sign when deserializing to primitive
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 26, 2023
1 parent d094ba1 commit 8fa21e5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,13 @@ fn test_numbers() {
}
}

#[test]
fn test_nan() {
// There is no negative NaN in YAML.
assert!(serde_yaml::from_str::<f32>(".nan").unwrap().is_sign_positive());
assert!(serde_yaml::from_str::<f64>(".nan").unwrap().is_sign_positive());
}

#[test]
fn test_stateful() {
struct Seed(i64);
Expand Down

0 comments on commit 8fa21e5

Please sign in to comment.