Skip to content

Commit 82c6912

Browse files
Update rustdoc headings tests
1 parent 5452d92 commit 82c6912

4 files changed

+22
-12
lines changed

tests/rustdoc-gui/docblock-details.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ reload:
66

77
// We first check that the headers in the `.top-doc` doc block still have their
88
// bottom border.
9-
assert-text: (".top-doc .docblock > h3", "Hello")
9+
assert-text: (".top-doc .docblock > h3", "§Hello")
1010
assert-css: (
1111
".top-doc .docblock > h3",
1212
{"border-bottom": "1px solid #d2d2d2"},

tests/rustdoc/disambiguate-anchors-header-29449.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,23 @@
55
pub struct Foo;
66

77
impl Foo {
8-
// @has - '//*[@id="examples"]//a' 'Examples'
9-
// @has - '//*[@id="panics"]//a' 'Panics'
8+
// @has - '//*[@id="examples"]' 'Examples'
9+
// @has - '//*[@id="examples"]/a[@href="#examples"]' '§'
10+
// @has - '//*[@id="panics"]' 'Panics'
11+
// @has - '//*[@id="panics"]/a[@href="#panics"]' '§'
1012
/// # Examples
1113
/// # Panics
1214
pub fn bar() {}
1315

14-
// @has - '//*[@id="examples-1"]//a' 'Examples'
16+
// @has - '//*[@id="examples-1"]' 'Examples'
17+
// @has - '//*[@id="examples-1"]/a[@href="#examples-1"]' '§'
1518
/// # Examples
1619
pub fn bar_1() {}
1720

18-
// @has - '//*[@id="examples-2"]//a' 'Examples'
19-
// @has - '//*[@id="panics-1"]//a' 'Panics'
21+
// @has - '//*[@id="examples-2"]' 'Examples'
22+
// @has - '//*[@id="examples-2"]/a[@href="#examples-2"]' '§'
23+
// @has - '//*[@id="panics-1"]' 'Panics'
24+
// @has - '//*[@id="panics-1"]/a[@href="#panics-1"]' '§'
2025
/// # Examples
2126
/// # Panics
2227
pub fn bar_2() {}
+7-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
// It actually checks that the link is kept in the headings as expected now.
2+
13
#![crate_name = "foo"]
24

35
// @has foo/fn.foo.html
4-
// @!has - '//a[@href="http://a.a"]' ''
5-
// @has - '//a[@href="#implementing-stuff-somewhere"]' 'Implementing stuff somewhere'
6-
// @has - '//a[@href="#another-one-urg"]' 'Another one urg'
6+
// @has - '//a[@href="http://a.a"]' 'stuff'
7+
// @has - '//*[@id="implementing-stuff-somewhere"]' 'Implementing stuff somewhere'
8+
// @has - '//a[@href="http://b.b"]' 'one'
9+
// @has - '//*[@id="another-one-urg"]' 'Another one urg'
710

811
/// fooo
912
///
@@ -13,5 +16,5 @@
1316
///
1417
/// # Another [one][two] urg
1518
///
16-
/// [two]: http://a.a
19+
/// [two]: http://b.b
1720
pub fn foo() {}

tests/rustdoc/short-docblock.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
// @has foo/index.html '//*[@class="desc docblock-short"]' 'fooo'
44
// @!has foo/index.html '//*[@class="desc docblock-short"]/h1' 'fooo'
5-
// @has foo/fn.foo.html '//h2[@id="fooo"]/a[@href="#fooo"]' 'fooo'
65

6+
// @has foo/fn.foo.html '//h2[@id="fooo"]' 'fooo'
7+
// @has foo/fn.foo.html '//h2[@id="fooo"]/a[@href="#fooo"]' '§'
78
/// # fooo
89
///
910
/// foo
1011
pub fn foo() {}
1112

1213
// @has foo/index.html '//*[@class="desc docblock-short"]' 'mooood'
1314
// @!has foo/index.html '//*[@class="desc docblock-short"]/h2' 'mooood'
14-
// @has foo/foo/index.html '//h3[@id="mooood"]/a[@href="#mooood"]' 'mooood'
1515

16+
// @has foo/foo/index.html '//h3[@id="mooood"]' 'mooood'
17+
// @has foo/foo/index.html '//h3[@id="mooood"]/a[@href="#mooood"]' '§'
1618
/// ## mooood
1719
///
1820
/// foo mod

0 commit comments

Comments
 (0)