summaryrefslogtreecommitdiffstats
path: root/openpgp/tests
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-02-05 15:10:15 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-02-05 17:07:07 +0100
commitef80b2ef0f4d783ead18a89325c7b59b2d01d787 (patch)
tree55d53b309dcdde05f1f32fb0931ada57a9de0427 /openpgp/tests
parentfae91df0be8ae78786866596bbc81c49047df057 (diff)
openpgp: Dump certificate if they do not match.
Diffstat (limited to 'openpgp/tests')
-rw-r--r--openpgp/tests/for-each-artifact.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/openpgp/tests/for-each-artifact.rs b/openpgp/tests/for-each-artifact.rs
index 229fab17..2d1b1822 100644
--- a/openpgp/tests/for-each-artifact.rs
+++ b/openpgp/tests/for-each-artifact.rs
@@ -47,17 +47,22 @@ mod for_each_artifact {
if p != q {
eprintln!("roundtripping {:?} failed", src);
- let p : Vec<openpgp::Packet> = p.clone().into_packets().collect();
- let q : Vec<openpgp::Packet> = q.clone().into_packets().collect();
+ let p_: Vec<_> = p.clone().into_packets().collect();
+ let q_: Vec<_> = q.clone().into_packets().collect();
eprintln!("original: {} packets; roundtripped: {} packets",
- p.len(), q.len());
- for (i, (p, q)) in p.iter().zip(q.iter()).enumerate() {
+ p_.len(), q_.len());
+
+ for (i, (p, q)) in p_.iter().zip(q_.iter()).enumerate() {
if p != q {
eprintln!("First difference at packet {}:\nOriginal: {:?}\nNew: {:?}",
i, p, q);
break;
}
}
+
+ eprintln!("This is the recovered cert:\n{}",
+ String::from_utf8_lossy(
+ &q.armored().to_vec().unwrap()));
}
assert_eq!(p, q, "roundtripping {:?} failed", src);