Skip to content

Commit

Permalink
Rollup merge of rust-lang#23839 - tyrion:patch-1, r=alexcrichton
Browse files Browse the repository at this point in the history
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"
  • Loading branch information
Manishearth committed Mar 31, 2015
2 parents 4038593 + b77a09c commit a4da0d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/doc/trpl/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ pub fn add_two(a: i32) -> i32 {
}
#[cfg(test)]
mod tests {
mod test {
use super::add_two;
#[test]
Expand All @@ -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
Expand All @@ -260,7 +260,7 @@ pub fn add_two(a: i32) -> i32 {
}
#[cfg(test)]
mod tests {
mod test {
use super::*;
#[test]
Expand Down

0 comments on commit a4da0d8

Please sign in to comment.