diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-10-26 15:01:57 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-10-26 21:34:53 +0100 |
| commit | b4c35368f41c36484cfa7679acb53d40ffbcce35 (patch) | |
| tree | 1b5ea410aef1a35d1536508250e0cdc0b66836a9 /src/test/rustdoc | |
| parent | 06fe27866920b3eaf6502f321ccb239cc617db10 (diff) | |
| download | rust-b4c35368f41c36484cfa7679acb53d40ffbcce35.tar.gz rust-b4c35368f41c36484cfa7679acb53d40ffbcce35.zip | |
Add test for doc comments unindent fix
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/unindent.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/rustdoc/unindent.rs b/src/test/rustdoc/unindent.rs new file mode 100644 index 00000000000..5e3d71ae7d0 --- /dev/null +++ b/src/test/rustdoc/unindent.rs @@ -0,0 +1,23 @@ +#![crate_name = "foo"] + +// @has foo/struct.Example.html +// @matches - '//pre[@class="rust rust-example-rendered"]' \ +// '(?m)let example = Example::new\(\)\n \.first\(\)\n \.second\(\)\n \.build\(\);\Z' +/// ```rust +/// let example = Example::new() +/// .first() +#[cfg_attr(not(feature = "one"), doc = " .second()")] +/// .build(); +/// ``` +pub struct Example; + +// @has foo/struct.F.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 F; |
