Update rustdoc tests

This commit is contained in:
Guillaume Gomez
2022-07-05 15:10:12 +02:00
parent 499e024ac9
commit 05e69d8fc6
10 changed files with 34 additions and 23 deletions

View File

@@ -16,8 +16,16 @@ assert-attribute: ("#implementors-list .impl:nth-child(2) > a.anchor", {"href":
assert: "#implementors-list .impl:nth-child(2) > .code-header.in-band"
goto: file://|DOC_PATH|/test_docs/struct.HasEmptyTraits.html
compare-elements-position-near-false: ("#impl-EmptyTrait1", "#impl-EmptyTrait2", {"y": 30})
compare-elements-position-near: ("#impl-EmptyTrait3 h3", "#impl-EmptyTrait3 .item-info", {"y": 30})
compare-elements-position-near-false: (
"#impl-EmptyTrait1-for-HasEmptyTraits",
"#impl-EmptyTrait2-for-HasEmptyTraits",
{"y": 30},
)
compare-elements-position-near: (
"#impl-EmptyTrait3-for-HasEmptyTraits h3",
"#impl-EmptyTrait3-for-HasEmptyTraits .item-info",
{"y": 30},
)
// Now check that re-exports work correctly.
// There should be exactly one impl shown on both of these pages.

View File

@@ -15,14 +15,17 @@ assert-text: (
// Checking the "item-info" on an impl block as well:
goto: file://|DOC_PATH|/lib2/struct.LongItemInfo2.html
compare-elements-property: (
"#impl-SimpleTrait .item-info",
"#impl-SimpleTrait + .docblock",
"#impl-SimpleTrait-for-LongItemInfo2 .item-info",
"#impl-SimpleTrait-for-LongItemInfo2 + .docblock",
["scrollWidth"],
)
assert-property: ("#impl-SimpleTrait .item-info", {"scrollWidth": "866"})
assert-property: (
"#impl-SimpleTrait-for-LongItemInfo2 .item-info",
{"scrollWidth": "866"},
)
// Just to be sure we're comparing the correct "item-info":
assert-text: (
"#impl-SimpleTrait .item-info",
"#impl-SimpleTrait-for-LongItemInfo2 .item-info",
"Available on Android or Linux or Emscripten or DragonFly BSD",
STARTS_WITH,
)