Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
majewsky
· 8y ago · 0 comments
Doc tests are their own thing, right? When I do `cargo test`, it looks like it's doing two passes: one for unit tests (like described in the article), and one for doc tests.
Comments
[–]
djrenren
8y ago
Yeah, doc tests are part of rustdoc and they essentially strip out the comments and generate test functions using libtest. I'm not very familiar with the internals, but they're here:
https://github.com/rust-lang/rust/blob/master/src/librustdoc...
[–]
steveklabnik
8y ago
They still use this infrastructure; think of it as a specific way to construct this kind of test.