diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-03-31 09:04:37 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-03-31 09:04:37 +0530 |
| commit | a4da0d83d0996a6e008dc2dd85d9cf0d2026d437 (patch) | |
| tree | d34d42db1f599639a44ada359ac9d86bc687b885 /src | |
| parent | 403859322821d94748ff5aa09850939fb4fc5b72 (diff) | |
| parent | b77a09c17e55e62bb5d7b2ce7ad5a138a77cba74 (diff) | |
| download | rust-a4da0d83d0996a6e008dc2dd85d9cf0d2026d437.tar.gz rust-a4da0d83d0996a6e008dc2dd85d9cf0d2026d437.zip | |
Rollup merge of #23839 - tyrion:patch-1, r=alexcrichton
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. Also in the output of the command we can see: ``` test test::it_works ... ok ``` So I think the name of the module was meant to be "test"
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/trpl/testing.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/trpl/testing.md b/src/doc/trpl/testing.md index 8fb08e1c6cf..8b2c14526cb 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] |
