aboutsummaryrefslogtreecommitdiff
path: root/src/test_macros.rs
diff options
context:
space:
mode:
authorJoey Sacchini <joey@sacchini.net>2020-10-09 18:42:32 -0400
committerJoey Sacchini <joey@sacchini.net>2020-10-09 18:42:32 -0400
commitfafe72ac2d97bd5c94ad55bd55526c2dcba9b8ff (patch)
treede32700329d34bb811ca47170e4e41aeedeb68c0 /src/test_macros.rs
parentbda2a204d8a44d94a76ac94f4dd33682ac1b05d3 (diff)
downloadmcproto-rs-fafe72ac2d97bd5c94ad55bd55526c2dcba9b8ff.tar.gz
mcproto-rs-fafe72ac2d97bd5c94ad55bd55526c2dcba9b8ff.tar.bz2
mcproto-rs-fafe72ac2d97bd5c94ad55bd55526c2dcba9b8ff.zip
fix broken lighting data and totally rewrite chat engine
Diffstat (limited to 'src/test_macros.rs')
-rw-r--r--src/test_macros.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/test_macros.rs b/src/test_macros.rs
index 8283d30..254c3bb 100644
--- a/src/test_macros.rs
+++ b/src/test_macros.rs
@@ -19,9 +19,15 @@ macro_rules! packet_test_cases {
data: bytes.as_slice(),
};
- let deserialized =
- <$pnam>::mc_deserialize(raw_packet).expect("deserialize succeeds");
- assert_eq!(packet, deserialized);
+ let deserialized = match <$pnam>::mc_deserialize(raw_packet) {
+ Err(err) => {
+ eprintln!("expected: {:?}", packet);
+ panic!("error: {:?}", err);
+ },
+ Ok(out) => out
+ };
+ assert_eq!(packet, deserialized, "deserialize(serialize(packet)) == packet");
+ assert_eq!(packet.clone(), deserialized.clone(), "deserialized.clone() == packet.clone()")
}
}