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.
This commit is contained in:
parent
c5370be36e
commit
b77a09c17e
1 changed files with 3 additions and 3 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue