2019-04-24 22:26:42 +02:00
|
|
|
// compile-pass
|
|
|
|
|
// compile-flags:--test
|
|
|
|
|
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
|
|
|
|
|
|
2019-05-26 00:11:30 +01:00
|
|
|
// Crates like core have doctests gated on `cfg(not(test))` so we need to make
|
|
|
|
|
// sure `cfg(test)` is not active when running `rustdoc --test`.
|
|
|
|
|
|
2019-04-24 22:26:42 +02:00
|
|
|
/// this doctest will be ignored:
|
|
|
|
|
///
|
|
|
|
|
/// ```
|
|
|
|
|
/// assert!(false);
|
|
|
|
|
/// ```
|
2019-05-26 00:11:30 +01:00
|
|
|
#[cfg(test)]
|
2019-04-24 22:26:42 +02:00
|
|
|
pub struct Foo;
|
|
|
|
|
|
|
|
|
|
/// this doctest will be tested:
|
|
|
|
|
///
|
|
|
|
|
/// ```
|
|
|
|
|
/// assert!(true);
|
|
|
|
|
/// ```
|
2019-05-26 00:11:30 +01:00
|
|
|
#[cfg(not(test))]
|
2019-04-24 22:26:42 +02:00
|
|
|
pub struct Foo;
|