Skip to content

Conversation

@japaric
Copy link
Contributor

@japaric japaric commented Dec 24, 2014

#20075 introduced a bug where unmarked code fences weren't considered as doctests. This PR fixes the logic.


This passed check-stage1-rustdoc, and I manually checked that:

//! ```
//! println!("Hello")
//! ```
//!
//! ``` rust
//! println!("Hello")
//! ```
//!
//! ``` sh
//! println!("Hello")
//! ```
//!
//! ``` ignore
//! println!("Hello")
//! ```

Generated:

running 3 tests
test _2 ... ignored
test _0 ... ok
test _1 ... ok

I'd love to add that as a test, but I have no idea how to do that with our testing infrastructure. If anyone knows how, do let me know!

r? @alexcrichton
@seanmonstar feedback?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\o/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had started a macro t! where you would do t!("sh", rust == false) and t!("", rust == true, no_run == false) or whatever. But the table at least makes things easier to see.

geomaster added a commit to geomaster/cargo that referenced this pull request Dec 24, 2014
Two tests (test_with_deep_lib_dep and lib_with_standard_name) fail due
to a bug in rustdoc (see rust-lang/rust#20183) so temporarily changing
these so they pass. Be sure to change it back when the fix lands in the
current rust nightly
@aidanhs
Copy link
Contributor

aidanhs commented Dec 25, 2014

So this is why my doctests have gone silent. Eagerly awaiting bors...

bors added a commit that referenced this pull request Dec 26, 2014
#20075 introduced a bug where unmarked code fences weren't considered as doctests. This PR fixes the logic.

---

This passed `check-stage1-rustdoc`, and I manually checked that:

``` rust
//! ```
//! println!("Hello")
//! ```
//!
//! ``` rust
//! println!("Hello")
//! ```
//!
//! ``` sh
//! println!("Hello")
//! ```
//!
//! ``` ignore
//! println!("Hello")
//! ```
```

Generated:

``` rust
running 3 tests
test _2 ... ignored
test _0 ... ok
test _1 ... ok
```

I'd love to add that as a test, but I have no idea how to do that with our testing infrastructure. If anyone knows how, do let me know!

r? @alexcrichton 
@seanmonstar feedback?
@bors bors merged commit 86d8579 into rust-lang:master Dec 26, 2014
@japaric japaric deleted the doctests branch January 4, 2015 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants