MCPcopy Index your code
hub / github.com/davidhewitt/pythonize / test_int_limits

Function test_int_limits

src/de.rs:972–1001  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

970
971 #[test]
972 fn test_int_limits() {
973 Python::attach(|py| {
974 // serde_json::Value supports u64 and i64 as maximum sizes
975 let _: serde_json::Value = depythonize(&u8::MAX.into_pyobject(py).unwrap()).unwrap();
976 let _: serde_json::Value = depythonize(&u8::MIN.into_pyobject(py).unwrap()).unwrap();
977 let _: serde_json::Value = depythonize(&i8::MAX.into_pyobject(py).unwrap()).unwrap();
978 let _: serde_json::Value = depythonize(&i8::MIN.into_pyobject(py).unwrap()).unwrap();
979
980 let _: serde_json::Value = depythonize(&u16::MAX.into_pyobject(py).unwrap()).unwrap();
981 let _: serde_json::Value = depythonize(&u16::MIN.into_pyobject(py).unwrap()).unwrap();
982 let _: serde_json::Value = depythonize(&i16::MAX.into_pyobject(py).unwrap()).unwrap();
983 let _: serde_json::Value = depythonize(&i16::MIN.into_pyobject(py).unwrap()).unwrap();
984
985 let _: serde_json::Value = depythonize(&u32::MAX.into_pyobject(py).unwrap()).unwrap();
986 let _: serde_json::Value = depythonize(&u32::MIN.into_pyobject(py).unwrap()).unwrap();
987 let _: serde_json::Value = depythonize(&i32::MAX.into_pyobject(py).unwrap()).unwrap();
988 let _: serde_json::Value = depythonize(&i32::MIN.into_pyobject(py).unwrap()).unwrap();
989
990 let _: serde_json::Value = depythonize(&u64::MAX.into_pyobject(py).unwrap()).unwrap();
991 let _: serde_json::Value = depythonize(&u64::MIN.into_pyobject(py).unwrap()).unwrap();
992 let _: serde_json::Value = depythonize(&i64::MAX.into_pyobject(py).unwrap()).unwrap();
993 let _: serde_json::Value = depythonize(&i64::MIN.into_pyobject(py).unwrap()).unwrap();
994
995 let _: u128 = depythonize(&u128::MAX.into_pyobject(py).unwrap()).unwrap();
996 let _: i128 = depythonize(&u128::MIN.into_pyobject(py).unwrap()).unwrap();
997
998 let _: i128 = depythonize(&i128::MAX.into_pyobject(py).unwrap()).unwrap();
999 let _: i128 = depythonize(&i128::MIN.into_pyobject(py).unwrap()).unwrap();
1000 });
1001 }
1002
1003 #[test]
1004 fn test_deserialize_bytes() {

Callers

nothing calls this directly

Calls 1

depythonizeFunction · 0.85

Tested by

no test coverage detected