/// Kindly inspired to the macro from DataFusion /// `assert_batch_eq!(expected_lines: &[&str], batches: &[RecordBatch])` #[macro_export] macro_rules! assert_batches_eq { ($EXPECTED_LINES: expr, $CHUNKS: expr) => { let expected_lines: Vec = $EXPECTED_LINES.iter().map(|&s| s.into()).collect(); let formatted = arrow::util::pretty::pretty_format_batches($CHUNKS) .unwrap() .to_string(); let actual_lines: Vec<&str> = formatted.trim().lines().collect(); assert_eq!( expected_lines, actual_lines, "\n\nexpected:\n\n{:#?}\nactual:\n\n{:#?}\n\n", expected_lines, actual_lines ); }; }