Skip to content

Apache DataFusion SQL Query Engine

Actually test that `ScalarValue`s are the same after round trip serialization (#3537)

Andrew Lambe87342310e20
diff --git a/datafusion/proto/src/lib.rs b/datafusion/proto/src/lib.rs
index 4a1e782f3b..f34da705f9 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
+ );
}
}