Weijun-H commented on code in PR #10363:
URL: https://github.com/apache/datafusion/pull/10363#discussion_r1597623051
##########
datafusion/common/src/test_util.rs:
##########
@@ -52,6 +52,22 @@ macro_rules! assert_batches_eq {
};
}
+#[macro_export]
+macro_rules! assert_snapshot {
+ ($CHUNKS: expr) => {
+ let formatted =
$crate::arrow::util::pretty::pretty_format_batches_with_options(
+ $CHUNKS,
+ &$crate::format::DEFAULT_FORMAT_OPTIONS,
+ )
+ .unwrap()
+ .to_string();
+
+ let actual_lines: Vec<&str> = formatted.trim().lines().collect();
+
+ insta::assert_yaml_snapshot!(actual_lines);
+ };
+}
+
Review Comment:
Why do we use this for tests?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]