summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openpgp/tests/for-each-artifact.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/openpgp/tests/for-each-artifact.rs b/openpgp/tests/for-each-artifact.rs
index 8979ccaa..ec546a7c 100644
--- a/openpgp/tests/for-each-artifact.rs
+++ b/openpgp/tests/for-each-artifact.rs
@@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};
extern crate sequoia_openpgp as openpgp;
use openpgp::parse::*;
-use openpgp::serialize::Serialize;
+use openpgp::serialize::*;
mod for_each_artifact {
use super::*;
@@ -18,6 +18,9 @@ mod for_each_artifact {
p.serialize(&mut v)?;
let q = openpgp::Packet::from_bytes(&v)?;
assert_eq!(p, &q, "roundtripping {:?} failed", src);
+ let w = p.to_vec().unwrap();
+ assert_eq!(v, w,
+ "Serialize and SerializeInto disagree on {:?}", p);
Ok(())
})
}).unwrap();
@@ -37,6 +40,10 @@ mod for_each_artifact {
p.as_tsk().serialize(&mut v)?;
let q = openpgp::TPK::from_bytes(&v)?;
assert_eq!(p, q, "roundtripping {:?} failed", src);
+
+ let w = p.as_tsk().to_vec().unwrap();
+ assert_eq!(v, w,
+ "Serialize and SerializeInto disagree on {:?}", p);
Ok(())
}).unwrap();
}
@@ -55,6 +62,10 @@ mod for_each_artifact {
p.serialize(&mut v)?;
let q = openpgp::Message::from_bytes(&v)?;
assert_eq!(p, q, "roundtripping {:?} failed", src);
+
+ let w = p.to_vec().unwrap();
+ assert_eq!(v, w,
+ "Serialize and SerializeInto disagree on {:?}", p);
Ok(())
}).unwrap();
}