Skip to content

Commit 9adbd9e

Browse files
committed
test: Add test for value greater than u128
1 parent 3bacea8 commit 9adbd9e

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/test_arbitrary_precision.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ fn test_float() {
4343
});
4444
}
4545

46+
#[test]
47+
fn test_greater_than_u128_max() {
48+
Python::attach(|py| {
49+
let json_str = r#"1.23e+100"#;
50+
let value: Value = serde_json::from_str(json_str).unwrap();
51+
let result = pythonize(py, &value).unwrap();
52+
let number_str = result.str().unwrap().to_string();
53+
54+
assert!(result.is_instance_of::<pyo3::types::PyFloat>());
55+
assert_eq!(number_str, "1.23e+100");
56+
});
57+
}
58+
4659
#[test]
4760
fn test_int() {
4861
Python::attach(|py| {

0 commit comments

Comments
 (0)