Skip to content

Commit e2efcf1

Browse files
committed
Fixing the test rustdoc by ignoring *[@id="module-item"]//following-sibling::item-right relationship and rustdoc-gui
1 parent 6020c79 commit e2efcf1

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/etc/htmldocck.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ def check_tree_attr(tree, path, attr, pat, regexp):
365365

366366
def check_tree_text(tree, path, pat, regexp):
367367
path = normalize_xpath(path)
368+
print("normalize_xpath -> {}".format(path))
368369
ret = False
369370
try:
370371
for e in tree.findall(path):

src/test/rustdoc-gui/sidebar.goml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ assert-text: (".sidebar-elems > .items > ul > li:nth-child(4)", "Traits")
1313
assert-text: (".sidebar-elems > .items > ul > li:nth-child(5)", "Functions")
1414
assert-text: (".sidebar-elems > .items > ul > li:nth-child(6)", "Type Definitions")
1515
assert-text: (".sidebar-elems > .items > ul > li:nth-child(7)", "Keywords")
16-
assert-text: ("#structs + table td > a", "Foo")
17-
click: "#structs + table td > a"
16+
assert-text: ("#structs + .item-table .item-left > a", "Foo")
17+
click: "#structs + .item-table .item-left > a"
1818

1919
// PAGE: struct.Foo.html
2020
assert-count: (".sidebar .location", 2)
@@ -35,8 +35,8 @@ assert-text: (".sidebar-elems > .items > ul > li:nth-child(2)", "Structs")
3535
assert-text: (".sidebar-elems > .items > ul > li:nth-child(3)", "Traits")
3636
assert-text: (".sidebar-elems > .items > ul > li:nth-child(4)", "Functions")
3737
assert-text: (".sidebar-elems > .items > ul > li:nth-child(5)", "Type Definitions")
38-
assert-text: ("#functions + table td > a", "foobar")
39-
click: "#functions + table td > a"
38+
assert-text: ("#functions + .item-table .item-left > a", "foobar")
39+
click: "#functions + .item-table .item-left > a"
4040

4141
// PAGE: fn.foobar.html
4242
// In items containing no items (like functions or constants) and in modules, we have one
@@ -57,4 +57,4 @@ assert-text: (".sidebar > .location", "Module sub_sub_module")
5757
// We check that we don't have the crate list.
5858
assert-false: ".sidebar-elems > .crate"
5959
assert-text: (".sidebar-elems > .items > ul > li:nth-child(1)", "Functions")
60-
assert-text: ("#functions + table td > a", "foo")
60+
assert-text: ("#functions + .item-table .item-left > a", "foo")

src/test/rustdoc/short-docblock-codeblock.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![crate_name = "foo"]
22

3-
// @has foo/index.html '//*[@class="module-item"]//following-sibling::item-right[@class="docblock-short"]' ""
4-
// @!has foo/index.html '//*[@id="module-item"]//following-sibling::item-right[@class="docblock-short"]' "Some text."
5-
// @!has foo/index.html '//*[@id="module-item"]//following-sibling::item-right[@class="docblock-short"]' "let x = 12;"
3+
// @has foo/index.html '//item-right[@class="docblock-short"]' ""
4+
// @!has foo/index.html '//item-right[@class="docblock-short"]' "Some text."
5+
// @!has foo/index.html '//item-right[@class="docblock-short"]' "let x = 12;"
66

77
/// ```
88
/// let x = 12;

0 commit comments

Comments
 (0)