about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-10-29 11:43:07 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2020-10-29 11:43:21 +0100
commitfcee70f643d8a40fe82b784e50880d5f8af062c0 (patch)
treed4493face287220452be6f729a44b32556d14d5a /src/test
parent6bbb7fd26532682051f8d74db954ac1a8650b22c (diff)
downloadrust-fcee70f643d8a40fe82b784e50880d5f8af062c0.tar.gz
rust-fcee70f643d8a40fe82b784e50880d5f8af062c0.zip
Update tests
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc/unindent.md1
-rw-r--r--src/test/rustdoc/unindent.rs41
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;