diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-11-24 22:56:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-24 22:56:40 +0100 |
| commit | ae9681ecfad21f218ac3524dc798aafa35088202 (patch) | |
| tree | bda703d26d861283c32116c8afeb05bad13a2f89 /src/test/rustdoc | |
| parent | 3bc8fc80499630799a87f6486325929458860163 (diff) | |
| parent | 2e0bc33594118179bb4b3e12a86a6d74b7baed4a (diff) | |
| download | rust-ae9681ecfad21f218ac3524dc798aafa35088202.tar.gz rust-ae9681ecfad21f218ac3524dc798aafa35088202.zip | |
Rollup merge of #91199 - camelid:test-mixing-docs, r=GuillaumeGomez
rustdoc: Add test for mixing doc comments and attrs This is a step toward adding more test coverage to make it easier to remove the distinction between collapsed and uncollapsed doc values.
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/mixing-doc-comments-and-attrs.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/rustdoc/mixing-doc-comments-and-attrs.rs b/src/test/rustdoc/mixing-doc-comments-and-attrs.rs new file mode 100644 index 00000000000..c26d3a31987 --- /dev/null +++ b/src/test/rustdoc/mixing-doc-comments-and-attrs.rs @@ -0,0 +1,26 @@ +#![crate_name = "foo"] + +// @has 'foo/struct.S1.html' +// @count - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]/p' \ +// 1 +// @has - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]/p[1]' \ +// 'Hello world! Goodbye! Hello again!' + +#[doc = "Hello world!\n\n"] +/// Goodbye! +#[doc = " Hello again!\n"] +pub struct S1; + +// @has 'foo/struct.S2.html' +// @count - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]/p' \ +// 2 +// @has - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]/p[1]' \ +// 'Hello world!' +// @has - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]/p[2]' \ +// 'Goodbye! Hello again!' + +/// Hello world! +/// +#[doc = "Goodbye!"] +/// Hello again! +pub struct S2; |
