Skip to content

Commit

Permalink
Rollup merge of #91199 - camelid:test-mixing-docs, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GuillaumeGomez authored Nov 24, 2021
2 parents 3bc8fc8 + 2e0bc33 commit ae9681e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/test/rustdoc/mixing-doc-comments-and-attrs.rs
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit ae9681e

Please sign in to comment.