test for panic if float is too large for real8

This commit is contained in:
jan 2024-12-18 16:51:42 -08:00
parent a1e9a3f90c
commit babd7f1402

View File

@ -275,10 +275,16 @@ mod tests {
assert_eq!(decode_real8(0x4110 << 48), 1.0);
assert_eq!(decode_real8(0xC120 << 48), -2.0);
//TODO panics on invalid?
}
#[test]
#[should_panic]
fn test_encode_real8_panic() {
use crate::basic::encode_real8;
encode_real8(1e80);
}
#[test]
fn test_parse_real8() {
use crate::basic:: parse_real8;