Skip to content

Commit 1870887

Browse files
hovinenbcopybara-github
authored andcommitted
Add module-level documentation to the matcher_support, matchers, and prelude modules.
This documentation will be published to https://docs.rs/googletest and helps to explain what is intended to be placed in each of these modules. PiperOrigin-RevId: 531510595
1 parent 69cb0f6 commit 1870887

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

googletest/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ pub mod matcher;
2323
pub mod matcher_support;
2424
pub mod matchers;
2525

26+
/// Re-exports of the symbols in this crate which are most likely to be used.
27+
///
28+
/// This includes:
29+
/// * All assertion macros,
30+
/// * Traits and type definitions normally used by tests, and
31+
/// * All built-in matchers.
32+
///
33+
/// Typically, one imports everything in the prelude in one's test module:
34+
///
35+
/// ```
36+
/// mod tests {
37+
/// use googletest::prelude::*;
38+
/// }
39+
/// ```
2640
pub mod prelude {
2741
pub use super::matcher::Matcher;
2842
pub use super::matchers::*;

googletest/src/matcher_support/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
//! Utilities to facilitate writing matchers.
16+
//!
17+
//! Tests normally do not need to import anything from this module. Some of
18+
//! these facilities could be useful to downstream users writing custom
19+
//! matchers.
20+
1521
pub(crate) mod count_elements;
1622
pub mod description;
1723
pub(crate) mod edit_distance;
18-
pub(crate) mod zipped_iterator;
24+
pub(crate) mod zipped_iterator;

googletest/src/matchers/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
//! All built-in matchers of this crate are in submodules of this module.
16+
1517
pub mod all_matcher;
1618
pub mod anything_matcher;
1719
pub mod conjunction_matcher;

0 commit comments

Comments
 (0)