Skip to content

Commit a4da0d8

Browse files
committed
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"
2 parents 4038593 + b77a09c commit a4da0d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/trpl/testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ pub fn add_two(a: i32) -> i32 {
231231
}
232232
233233
#[cfg(test)]
234-
mod tests {
234+
mod test {
235235
use super::add_two;
236236
237237
#[test]
@@ -241,7 +241,7 @@ mod tests {
241241
}
242242
```
243243

244-
There's a few changes here. The first is the introduction of a `mod tests` with
244+
There's a few changes here. The first is the introduction of a `mod test` with
245245
a `cfg` attribute. The module allows us to group all of our tests together, and
246246
to also define helper functions if needed, that don't become a part of the rest
247247
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 {
260260
}
261261
262262
#[cfg(test)]
263-
mod tests {
263+
mod test {
264264
use super::*;
265265
266266
#[test]

0 commit comments

Comments
 (0)