From 67bba721be37ef5e191667ab1cf1c9028d55a11d Mon Sep 17 00:00:00 2001 From: Edmondo Porcu Date: Fri, 26 Jul 2024 14:08:45 +0000 Subject: [PATCH 1/2] Docs: adding explicit mention of test_utils to docs --- docs/source/contributor-guide/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/contributor-guide/testing.md b/docs/source/contributor-guide/testing.md index 0f4461ab2c2c..98bc733b6b6f 100644 --- a/docs/source/contributor-guide/testing.md +++ b/docs/source/contributor-guide/testing.md @@ -29,7 +29,7 @@ and tries to follow the Rust standard [Testing Organization](https://doc.rust-la ## Unit tests -Tests for code in an individual module are defined in the same source file with a `test` module, following Rust convention. +Tests for code in an individual module are defined in the same source file with a `test` module, following Rust convention. If you need to perform assertions on RecordBatch you can leverage the `assert_batches_sorted_eq` and `assert_contains` macros provided by the [test_util](https://github.com/apache/datafusion/tree/main/datafusion/common/src/test_util.rs) module. ## sqllogictests Tests From 8aad8319ff71e6aef33fa084275645c61a03c74c Mon Sep 17 00:00:00 2001 From: Edmondo Porcu Date: Fri, 26 Jul 2024 14:14:11 +0000 Subject: [PATCH 2/2] Improved wording --- docs/source/contributor-guide/testing.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/contributor-guide/testing.md b/docs/source/contributor-guide/testing.md index 98bc733b6b6f..90e39c0057c1 100644 --- a/docs/source/contributor-guide/testing.md +++ b/docs/source/contributor-guide/testing.md @@ -29,7 +29,8 @@ and tries to follow the Rust standard [Testing Organization](https://doc.rust-la ## Unit tests -Tests for code in an individual module are defined in the same source file with a `test` module, following Rust convention. If you need to perform assertions on RecordBatch you can leverage the `assert_batches_sorted_eq` and `assert_contains` macros provided by the [test_util](https://github.com/apache/datafusion/tree/main/datafusion/common/src/test_util.rs) module. +Tests for code in an individual module are defined in the same source file with a `test` module, following Rust convention. +The [test_util](https://github.com/apache/datafusion/tree/main/datafusion/common/src/test_util.rs) module provides useful macros to write unit tests effectively, such as `assert_batches_sorted_eq` and `assert_batches_eq` for RecordBatches and `assert_contains` / `assert_not_contains` which are used extensively in the codebase. ## sqllogictests Tests