diff --git a/src/tests/adding.md b/src/tests/adding.md index ebbbb1cfc..10483265c 100644 --- a/src/tests/adding.md +++ b/src/tests/adding.md @@ -17,8 +17,11 @@ guidelines: - The majority of standard library tests are written as doctests, which illustrate and exercise typical API behavior. - Additional [unit tests](intro.md#package-tests) should go in - `library/${crate}/tests` (where `${crate}` is usually `core`, `alloc`, or - `std`). + `library/${crate}/tests` (where `${crate}` is usually `std`). + - Tests for the `alloc` or `core` crates must go in separate crates: `alloctests` or `coretests` respectively. + - NOTE: That when adding unit tests for unstable features the `#![feature(...)]` + declaration must be added to `library/${crate}tests/tests/lib.rs` and not to + `library/${crate}tests/lib.rs`. - If the code is part of an isolated system, and you are not testing compiler output, consider using a [unit or integration test](intro.md#package-tests). - Need to run rustdoc? Prefer a `rustdoc` or `rustdoc-ui` test. Occasionally