From b77a09c17e55e62bb5d7b2ce7ad5a138a77cba74 Mon Sep 17 00:00:00 2001 From: Germano Gabbianelli Date: Sun, 29 Mar 2015 22:50:51 +0200 Subject: [PATCH] Fixed wrong name of test module in testing.md The documentation says that 'The current convention is to use the `test` module to hold your "unit-style"' but then defines the module as "tests" instead. --- src/doc/trpl/testing.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/trpl/testing.md b/src/doc/trpl/testing.md index 8fb08e1c6cfde..8b2c14526cbf0 100644 --- a/src/doc/trpl/testing.md +++ b/src/doc/trpl/testing.md @@ -231,7 +231,7 @@ pub fn add_two(a: i32) -> i32 { } #[cfg(test)] -mod tests { +mod test { use super::add_two; #[test] @@ -241,7 +241,7 @@ mod tests { } ``` -There's a few changes here. The first is the introduction of a `mod tests` with +There's a few changes here. The first is the introduction of a `mod test` with a `cfg` attribute. The module allows us to group all of our tests together, and to also define helper functions if needed, that don't become a part of the rest of our crate. The `cfg` attribute only compiles our test code if we're @@ -260,7 +260,7 @@ pub fn add_two(a: i32) -> i32 { } #[cfg(test)] -mod tests { +mod test { use super::*; #[test]