From 732ed2adc816eb600eac33a4cfcd2095c43be4f7 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 2 Apr 2022 17:05:27 +0200 Subject: [PATCH] Add test for multi-line attribute handling in doctests --- .../rustdoc-ui/doc-comment-multi-line-cfg-attr.rs | 12 ++++++++++++ .../doc-comment-multi-line-cfg-attr.stdout | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 src/test/rustdoc-ui/doc-comment-multi-line-cfg-attr.rs create mode 100644 src/test/rustdoc-ui/doc-comment-multi-line-cfg-attr.stdout diff --git a/src/test/rustdoc-ui/doc-comment-multi-line-cfg-attr.rs b/src/test/rustdoc-ui/doc-comment-multi-line-cfg-attr.rs new file mode 100644 index 00000000000..b2a8133c90e --- /dev/null +++ b/src/test/rustdoc-ui/doc-comment-multi-line-cfg-attr.rs @@ -0,0 +1,12 @@ +// compile-flags:--test +// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" +// check-pass + +/// ``` +/// # #![cfg_attr(not(dox), deny(missing_abi, +/// # non_ascii_idents))] +/// +/// pub struct Bar; +/// ``` +pub struct Bar; diff --git a/src/test/rustdoc-ui/doc-comment-multi-line-cfg-attr.stdout b/src/test/rustdoc-ui/doc-comment-multi-line-cfg-attr.stdout new file mode 100644 index 00000000000..bf3521e4f91 --- /dev/null +++ b/src/test/rustdoc-ui/doc-comment-multi-line-cfg-attr.stdout @@ -0,0 +1,6 @@ + +running 1 test +test $DIR/doc-comment-multi-line-cfg-attr.rs - Bar (line 6) ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME +