Add test that UnpackedScalar::{to,from}_bytes() roundtrips.

This commit is contained in:
Isis Lovecruft 2017-10-31 01:02:20 +00:00
parent f0102806a2
commit e2cbec81fc
Failed to extract signature

View file

@ -722,6 +722,15 @@ mod test {
assert_eq!(should_be_X, X);
}
#[test]
fn to_bytes_from_bytes_roundtrips() {
let unpacked = X.unpack();
let bytes = unpacked.to_bytes();
let should_be_unpacked = UnpackedScalar::from_bytes(&bytes);
assert_eq!(should_be_unpacked.0, unpacked.0);
}
#[cfg(feature = "serde")]
use serde_cbor;