jayzhan211 commented on code in PR #10363:
URL: https://github.com/apache/datafusion/pull/10363#discussion_r1599209667
##########
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:
test with `insta`. Because changing them manually is painful. I did this in
`datafusion-example`, since they are not `test`.
--
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]