diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-04 02:26:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-04 02:26:22 +0100 |
| commit | 420ddd0b7e1912c780a6af514986eb9185ff776b (patch) | |
| tree | 8d7d58b9266b86e63b77d825c0c23757156b3633 /src/test/rustdoc | |
| parent | 0bd4ee79e099a75a13396de272278c9ad8192bd5 (diff) | |
| parent | fe88fcfa3909219ab537a6de9213a48fffcce75e (diff) | |
| download | rust-420ddd0b7e1912c780a6af514986eb9185ff776b.tar.gz rust-420ddd0b7e1912c780a6af514986eb9185ff776b.zip | |
Rollup merge of #91209 - camelid:snapshot, r=jyn514
Implement `@snapshot` check for htmldocck This form of check allows performing snapshot tests (à la `src/test/ui`) on rustdoc HTML output, making it easier to create and update tests. See [this Zulip thread][1] for more information about the motivation for this change. [1]: https://zulip-archive.rust-lang.org/stream/266220-rustdoc/topic/HTML.20snapshot.20tests.html#262651142 r? `@GuillaumeGomez`
Diffstat (limited to 'src/test/rustdoc')
3 files changed, 10 insertions, 10 deletions
diff --git a/src/test/rustdoc/mixing-doc-comments-and-attrs.S1_top-doc.html b/src/test/rustdoc/mixing-doc-comments-and-attrs.S1_top-doc.html new file mode 100644 index 00000000000..69d647a92e8 --- /dev/null +++ b/src/test/rustdoc/mixing-doc-comments-and-attrs.S1_top-doc.html @@ -0,0 +1,4 @@ +<div class="docblock"><p>Hello world! +Goodbye! +Hello again!</p> +</div> \ No newline at end of file diff --git a/src/test/rustdoc/mixing-doc-comments-and-attrs.S2_top-doc.html b/src/test/rustdoc/mixing-doc-comments-and-attrs.S2_top-doc.html new file mode 100644 index 00000000000..8ff114b993e --- /dev/null +++ b/src/test/rustdoc/mixing-doc-comments-and-attrs.S2_top-doc.html @@ -0,0 +1,4 @@ +<div class="docblock"><p>Hello world!</p> +<p>Goodbye! +Hello again!</p> +</div> \ No newline at end of file diff --git a/src/test/rustdoc/mixing-doc-comments-and-attrs.rs b/src/test/rustdoc/mixing-doc-comments-and-attrs.rs index c26d3a31987..1aedd4d107c 100644 --- a/src/test/rustdoc/mixing-doc-comments-and-attrs.rs +++ b/src/test/rustdoc/mixing-doc-comments-and-attrs.rs @@ -1,10 +1,7 @@ #![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!' +// @snapshot S1_top-doc - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]' #[doc = "Hello world!\n\n"] /// Goodbye! @@ -12,12 +9,7 @@ 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!' +// @snapshot S2_top-doc - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]' /// Hello world! /// |
