diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-12-20 18:02:12 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-12-20 18:21:04 +0100 |
commit | 29bd0dd1045b16d4e2d73b1b0c23a1cb1c562972 (patch) | |
tree | 3b91d05ea575210b40094c5d0e3521f007fc21e0 /openpgp/tests | |
parent | cb9ab5c705e4a2913645761ac519c00263f6928b (diff) |
openpgp: Improve test.
Diffstat (limited to 'openpgp/tests')
-rw-r--r-- | openpgp/tests/for-each-artifact.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/openpgp/tests/for-each-artifact.rs b/openpgp/tests/for-each-artifact.rs index 8860b837..229fab17 100644 --- a/openpgp/tests/for-each-artifact.rs +++ b/openpgp/tests/for-each-artifact.rs @@ -17,10 +17,15 @@ mod for_each_artifact { let mut v = Vec::new(); 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); + if p != &q { + return Err(failure::format_err!( + "assertion failed: p == q\np = {:?}\nq = {:?}", p, q)); + } + let w = p.to_vec()?; + if v != w { + return Err(failure::format_err!( + "assertion failed: v == w\nv = {:?}\nw = {:?}", v, w)); + } Ok(()) }) }).unwrap(); |