diff options
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/packet/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/openpgp/src/packet/mod.rs b/openpgp/src/packet/mod.rs index 087814e3..db63da71 100644 --- a/openpgp/src/packet/mod.rs +++ b/openpgp/src/packet/mod.rs @@ -1073,10 +1073,21 @@ impl DerefMut for AED { #[cfg(test)] mod test { use super::*; + use crate::serialize::SerializeInto; + use crate::parse::Parse; #[test] fn packet_is_send_and_sync() { fn f<T: Send + Sync>(_: T) {} f(Packet::Marker(Default::default())); } + + quickcheck! { + fn roundtrip(p: Packet) -> bool { + let buf = p.to_vec().expect("Failed to serialize packet"); + let q = Packet::from_bytes(&buf).unwrap(); + assert_eq!(p, q); + true + } + } } |