Skip to content

Commit

Permalink
Fixed wrong name of test module in testing.md
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.
  • Loading branch information
tyrion committed Mar 29, 2015
1 parent c5370be commit b77a09c
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 b77a09c

Please sign in to comment.