You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/tests/adding.md
+7-2
Original file line number
Diff line number
Diff line change
@@ -31,14 +31,19 @@ rough heuristics:
31
31
suites
32
32
- need to run rustdoc? Prefer a `rustdoc` or `rustdoc-ui` test. Occasionally you'll need `rustdoc-js` as well.
33
33
- need to inspect the resulting binary in some way? Then use `run-make`
34
-
- Library tests should go in `library/$crate/tests` (where `$crate` is usually `core`, `alloc`, or `std`).
34
+
- Library tests should go in `library/${crate}/tests` (where `${crate}` is usually `core`, `alloc`, or `std`). Library tests include:
35
+
- tests that an API behaves properly, including accepting various types or having some runtime behavior
36
+
- tests where any compiler warnings are not relevant to the test
37
+
- tests that a use of an API gives a compile error, where the exact error message is not relevant to the test. These should have an [error number] (`E0XXX`) in the code block to make sure it's the correct error.
35
38
- For most other things, [a `ui` (or `ui-fulldeps`) test](#ui) is to be
36
39
preferred:
37
-
-`ui` tests subsume both `run-pass`, `compile-fail`, and `parse-fail` tests
40
+
-[`ui`](#ui) tests subsume both `run-pass`, `compile-fail`, and `parse-fail` tests
38
41
- in the case of warnings or errors, `ui` tests capture the full output,
39
42
which makes it easier to review but also helps prevent "hidden" regressions
0 commit comments