Move assert_batches_eq! macros to test_utils.rs #746
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #745, re #743
Rationale for this change
The
assert_batches_eq!
andassert_batches_sorted_eq!
macros are used to write easier to maintain tests. However, the macros are in thetest
module that is only compiled for tests of the datafusion crate and are not, therefore, available to the "integration" style tests insql.rs
I also find them so useful they are also in IOx in test_utils.rs
BTW the reason they are "easier to maintain tests" is that you can copy the output directly from the test failure into the code to update the results (rather than having to reformat it manually). For example, to generate the new output in sql.rs, I simply put a placeholder in and ran the test and then copy/pasted in the output of the test:
What changes are included in this PR?
assert_batches_eq!
andassert_batches_sorted_eq!
macros to test_utils.rsAre there any user-facing changes?
The
assert_batches_eq!
andassert_batches_sorted_eq!
macros are now part of the DataFusion public APIFollow on work is tracked in #743