Migrate a test to use @snapshot

I'd been thinking about implementing snapshot testing for a while, but
This test is what finally made me do it. It really benefits from using
snapshot testing, so it's a good initial place to use `@snapshot`.
This commit is contained in:
Noah Lev 2021-11-24 19:35:18 -08:00
parent e2846a779d
commit fe88fcfa39
3 changed files with 10 additions and 10 deletions

View file

@ -0,0 +1,4 @@
<div class="docblock"><p>Hello world!
Goodbye!
Hello again!</p>
</div>

View file

@ -0,0 +1,4 @@
<div class="docblock"><p>Hello world!</p>
<p>Goodbye!
Hello again!</p>
</div>

View file

@ -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!
///