about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-10-26 15:01:57 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2020-10-26 21:34:53 +0100
commitb4c35368f41c36484cfa7679acb53d40ffbcce35 (patch)
tree1b5ea410aef1a35d1536508250e0cdc0b66836a9 /src/test
parent06fe27866920b3eaf6502f321ccb239cc617db10 (diff)
downloadrust-b4c35368f41c36484cfa7679acb53d40ffbcce35.tar.gz
rust-b4c35368f41c36484cfa7679acb53d40ffbcce35.zip
Add test for doc comments unindent fix
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc/unindent.rs23
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;