diff options
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/unindent.md | 1 | ||||
| -rw-r--r-- | src/test/rustdoc/unindent.rs | 41 |
2 files changed, 42 insertions, 0 deletions
diff --git a/src/test/rustdoc/unindent.md b/src/test/rustdoc/unindent.md new file mode 100644 index 00000000000..8e4e7a25af8 --- /dev/null +++ b/src/test/rustdoc/unindent.md @@ -0,0 +1 @@ +Just some text. diff --git a/src/test/rustdoc/unindent.rs b/src/test/rustdoc/unindent.rs index 5e3d71ae7d0..d10e1ec89c5 100644 --- a/src/test/rustdoc/unindent.rs +++ b/src/test/rustdoc/unindent.rs @@ -1,3 +1,5 @@ +#![feature(external_doc)] + #![crate_name = "foo"] // @has foo/struct.Example.html @@ -21,3 +23,42 @@ pub struct Example; /// .build(); /// ``` pub struct F; + +// @has foo/struct.G.html +// @matches - '//pre[@class="rust rust-example-rendered"]' \ +// '(?m)let example = Example::new\(\)\n\.first\(\)\n \.another\(\)\n\.build\(\);\Z' +///```rust +///let example = Example::new() +///.first() +#[cfg_attr(not(feature = "one"), doc = " .another()")] +///.build(); +///``` +pub struct G; + +// @has foo/struct.H.html +// @has - '//div[@class="docblock"]/p' 'no whitespace lol' +///no whitespace +#[doc = " lol"] +pub struct H; + +// @has foo/struct.I.html +// @matches - '//pre[@class="rust rust-example-rendered"]' '(?m)4 whitespaces!\Z' +/// 4 whitespaces! +#[doc = "something"] +pub struct I; + +// @has foo/struct.J.html +// @matches - '//div[@class="docblock"]/p' '(?m)a\nno whitespace\nJust some text.\Z' +///a +///no whitespace +#[doc(include = "unindent.md")] +pub struct J; + +// @has foo/struct.K.html +// @matches - '//pre[@class="rust rust-example-rendered"]' '(?m)4 whitespaces!\Z' +///a +/// +/// 4 whitespaces! +/// +#[doc(include = "unindent.md")] +pub struct K; |
