From e1b468901ccd584f195efa76b6a13979840ccaf1 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Mon, 19 Sep 2022 16:03:22 -0400 Subject: [PATCH] Actually test that `ScalarValue`s are the same after round trip serialization --- datafusion/proto/src/lib.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/datafusion/proto/src/lib.rs b/datafusion/proto/src/lib.rs index 4a1e782f3be1f..f34da705f94a7 100644 --- a/datafusion/proto/src/lib.rs +++ b/datafusion/proto/src/lib.rs @@ -465,8 +465,17 @@ mod roundtrip_tests { let proto: super::protobuf::ScalarValue = (&test_case) .try_into() .expect("failed conversion to protobuf"); - let _roundtrip: ScalarValue = - (&proto).try_into().expect("failed conversion to protobuf"); + + let roundtrip: ScalarValue = (&proto) + .try_into() + .expect("failed conversion from protobuf"); + + assert_eq!( + test_case, roundtrip, + "ScalarValue was not the same after round trip!\n\n\ + Input: {:?}\n\nRoundtrip: {:?}", + test_case, roundtrip + ); } }