Skip to content

Commit 3e376f5

Browse files
Add and update rustdoc ui test
1 parent 169a1ca commit 3e376f5

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

src/test/rustdoc-ui/cfg-test.stdout

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

2-
running 1 test
2+
running 2 tests
3+
test $DIR/cfg-test.rs - Bar (line 28) ... ok
34
test $DIR/cfg-test.rs - Foo (line 20) ... ok
45

5-
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
6+
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
67

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// build-pass
2+
// compile-flags:--test
3+
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
4+
5+
#![feature(cfg_doctest)]
6+
7+
// Make sure `cfg(doctest)` is set when finding doctests but not inside
8+
// the doctests.
9+
10+
/// ```
11+
/// #![feature(cfg_doctest)]
12+
/// assert!(!cfg!(doctest));
13+
/// ```
14+
#[cfg(doctest)]
15+
pub struct Foo;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
running 1 test
3+
test $DIR/doc-test-doctest-feature.rs - Foo (line 10) ... ok
4+
5+
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
6+

0 commit comments

Comments
 (0)