Skip to content
Permalink
Browse files

Add test for rustdoc cfg(test) feature

  • Loading branch information...
GuillaumeGomez committed Apr 24, 2019
1 parent 8ed2292 commit 459d677bfffa0adeef75218d1cfa5f686e413f4d
Showing with 25 additions and 0 deletions.
  1. +19 −0 src/test/rustdoc-ui/cfg-test.rs
  2. +6 −0 src/test/rustdoc-ui/cfg-test.stdout
@@ -0,0 +1,19 @@
// compile-pass
// compile-flags:--test
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"

/// this doctest will be ignored:
///
/// ```
/// assert!(false);
/// ```
#[cfg(not(test))]
pub struct Foo;

/// this doctest will be tested:
///
/// ```
/// assert!(true);
/// ```
#[cfg(test)]
pub struct Foo;
@@ -0,0 +1,6 @@

running 1 test
test $DIR/cfg-test.rs - Foo (line 15) ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

0 comments on commit 459d677

Please sign in to comment.
You can’t perform that action at this time.