Skip to content

Commit e42495f

Browse files
tshepangJohnTitor
andauthored
improve explanation of placing tests in separate file (rust-lang#1721)
Co-authored-by: Yuki Okushi <[email protected]>
1 parent fd0505a commit e42495f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/tests/intro.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,19 @@ The standard library relies very heavily on documentation tests to cover its fun
4343
However, unit tests and integration tests can also be used as needed.
4444
Almost all of the compiler packages have doctests disabled.
4545

46-
The standard library and compiler always place all unit tests in a separate `tests` file
47-
(this is enforced in [tidy][tidy-unit-tests]).
48-
This approach ensures that when the test file is changed, the crate does not need to be recompiled.
46+
All standard library and compiler unit tests are placed in separate `tests` file
47+
(which is enforced in [tidy][tidy-unit-tests]).
48+
This ensures that when the test file is changed, the crate does not need to be recompiled.
4949
For example:
5050

5151
```rust,ignore
5252
#[cfg(test)]
5353
mod tests;
5454
```
5555

56-
If it wasn't done this way, and the tests were placed in the same file as the source,
57-
then changing or adding a test would cause the crate you are working on to be recompiled.
58-
If you were working on something like `core`,
59-
then that would require recompiling the entire standard library, and the entirety of `rustc`.
56+
If it wasn't done this way,
57+
and you were working on something like `core`,
58+
that would require recompiling the entire standard library, and the entirety of `rustc`.
6059

6160
`./x test` includes some CLI options for controlling the behavior with these tests:
6261

0 commit comments

Comments
 (0)