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: guide/src/cli/test.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
# The test command
2
2
3
3
When writing a book, you may want to provide some code samples,
4
-
and it's important that these be accurate.
4
+
and it's important that these be kept accurate as your software API evolves.
5
5
For example,
6
6
[The Rust Programming Book](https://doc.rust-lang.org/stable/book/) uses a lot
7
-
of code samples that could get outdated as the language evolves. Therefore it is very important for
8
-
them to be able to automatically test these code examples.
7
+
of code samples that could become outdated as the language evolves.
9
8
10
-
mdBook supports a `test` command that will run code samples as doc tests for your book. At
11
-
the moment, only Rust doc tests are supported.
9
+
MdBook supports a `test` command which runs code samples in your book as doc tests to verify they
10
+
will compile, and, optionally, run correctly.
11
+
At the moment, mdBook only supports doc *tests* written in Rust, although code samples can be written and *displayed* in many programming languages.
12
12
13
13
#### Specify a directory
14
14
@@ -33,8 +33,8 @@ book using the chapter name or the relative path to the chapter.
33
33
34
34
#### `--library-path``[`deprecated`]`
35
35
36
-
> Note: This argument doesn't provide sufficient externcrate information to run doc tests in current Rust compilers.
37
-
Instead, add **manifest** to point to a **Cargo.toml** file in your ***book.toml***, as described in [rust configuration](/format/configuration/general.html#rust-options).
36
+
***Note*** This argument is deprecated. Since Rust edition 2018, the compiler needs an explicit `--extern` argument for each external crate used in a doc test, it no longer simply scans the library path for likely-looking crates.
37
+
New projects should list external crates as dependencies in a **Cargo.toml** file and reference that file in your ***book.toml***, as described in [rust configuration](/format/configuration/general.html#rust-options).
38
38
39
39
40
40
The `--library-path` (`-L`) option allows you to add directories to the library
0 commit comments