summaryrefslogtreecommitdiffstats
path: root/openpgp/src
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2018-11-01 15:53:42 +0100
committerJustus Winter <justus@sequoia-pgp.org>2018-11-01 15:53:42 +0100
commit08e8d76ac34353a93164521a6b774cf791ed3297 (patch)
tree4502e16597b19266ef7fb8f62eb3f1850ae7aacd /openpgp/src
parente65ca5288f784c3a457e56c9f3cc124b7a23e142 (diff)
openpgp: Add test.
- Fixes #47.
Diffstat (limited to 'openpgp/src')
-rw-r--r--openpgp/src/tpk/mod.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/openpgp/src/tpk/mod.rs b/openpgp/src/tpk/mod.rs
index 293d7094..a9a7eb26 100644
--- a/openpgp/src/tpk/mod.rs
+++ b/openpgp/src/tpk/mod.rs
@@ -3165,4 +3165,16 @@ mod test {
bytes!("already-revoked-private.pgp")).unwrap();
assert!(tpk.is_tsk());
}
+
+ #[test]
+ fn export_only_exports_public_key() {
+ let tpk = TPK::from_bytes(
+ bytes!("testy-new-private.pgp")).unwrap();
+ assert!(tpk.is_tsk());
+
+ let mut v = Vec::new();
+ tpk.serialize(&mut v).unwrap();
+ let tpk = TPK::from_bytes(&v).unwrap();
+ assert!(! tpk.is_tsk());
+ }
}