Skip to content

Commit d3f35e9

Browse files
Add test for --no-html-source flag
1 parent 7ab27c5 commit d3f35e9

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/rustdoc/html-no-source.rs

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// compile-flags: -Zunstable-options --html-no-source
2+
3+
// This test ensures that the `--html-no-source` flag disables
4+
// the creation of the `src` folder.
5+
6+
#![feature(staged_api)]
7+
#![stable(feature = "bar", since = "1.0")]
8+
#![crate_name = "foo"]
9+
10+
// Ensures that there is no items in the corresponding "src" folder.
11+
// @files 'src/foo' '[]'
12+
13+
// @has foo/fn.foo.html
14+
// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 · '
15+
// @!has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 · source · '
16+
#[stable(feature = "bar", since = "1.0")]
17+
pub fn foo() {}
18+
19+
// @has foo/struct.Bar.html
20+
// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 · '
21+
// @!has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 · source · '
22+
#[stable(feature = "bar", since = "1.0")]
23+
pub struct Bar;
24+
25+
impl Bar {
26+
// @has - '//*[@id="method.bar"]/*[@class="since rightside"]' '2.0'
27+
// @!has - '//*[@id="method.bar"]/*[@class="rightside"]' '2.0 ·'
28+
#[stable(feature = "foobar", since = "2.0")]
29+
pub fn bar() {}
30+
}

0 commit comments

Comments
 (0)