-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
157: Be smarter about integer deserialization r=torkleyy a=torkleyy Now, `deserialize_any` will try to find the best representation possible. This is not a very pretty implementation, but it should work well. Fixes #100 Fixes #155 Co-authored-by: Thomas Schaller <torkleyy@gmail.com>
- Loading branch information
Showing
4 changed files
with
129 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use ron::value::Number; | ||
|
||
#[test] | ||
fn test_large_number() { | ||
use ron::value::Value; | ||
let test_var = Value::Number(Number::new(10000000000000000000000.0f64)); | ||
let test_ser = ron::ser::to_string(&test_var).unwrap(); | ||
let test_deser = ron::de::from_str::<Value>(&test_ser); | ||
|
||
assert_eq!(test_deser.unwrap(), Value::Number(Number::new(10000000000000000000000.0))); | ||
} |