-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
A-TestsArea: `mbdook test` related testsArea: `mbdook test` related tests
Description
What happened:
I'm experimenting with extracting code examples from TRPL into their own files for a variety of reasons. However, I'd like to retain the mdbook test functionality.
I then ran mdbook test, and got this error (mdbook --version = v0.1.7):
failures:
---- /var/folders/qc/0ry2bjtd7wd9q8r1c7wylplr0000gn/T/mdbookmFaM3A/ch03-01-variables-and-mutability.md - _::Variables_and_Mutability (line 74) stdout ----
error: expected `[`, found `include`
--> /var/folders/qc/0ry2bjtd7wd9q8r1c7wylplr0000gn/T/mdbookmFaM3A/ch03-01-variables-and-mutability.md:75:4
|
3 | {{#include ../examples/ch03-01-variables-and-mutability/unnumbered-02/src/main.rs }}
| ^^^^^^^ expected `[`
thread '/var/folders/qc/0ry2bjtd7wd9q8r1c7wylplr0000gn/T/mdbookmFaM3A/ch03-01-variables-and-mutability.md - _::Variables_and_Mutability (line 74)' panicked at 'couldn't compile the test', librustdoc/test.rs:332:13
I just tried with mdbook 0.2.2 and got the same result. I'm using Rust 1.31.0.
What I expected to happen:
I expected the #include preprocessing to happen before running doctests so that mdbook test would have the same behavior as it did before I extracted the file. It looks like that's not happening because rustdoc is trying to compile {{#include.
CjS77 and eddyp
Metadata
Metadata
Assignees
Labels
A-TestsArea: `mbdook test` related testsArea: `mbdook test` related tests