Skip to content

Commit cd48154

Browse files
committed
rustdoc: fix GUI tests to deal with slightly changed width
1 parent e3cb0a8 commit cd48154

7 files changed

+12
-12
lines changed

src/test/rustdoc-gui/code-blocks-overflow.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ size: (1080, 600)
55
assert-count: (".docblock > .example-wrap", 2)
66
assert: ".docblock > .example-wrap > .language-txt"
77
assert: ".docblock > .example-wrap > .rust-example-rendered"
8-
assert-css: (".docblock > .example-wrap > pre", {"width": "785.25px", "overflow-x": "auto"}, ALL)
8+
assert-css: (".docblock > .example-wrap > pre", {"width": "796px", "overflow-x": "auto"}, ALL)

src/test/rustdoc-gui/docblock-table-overflow.goml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ goto: file://|DOC_PATH|/lib2/long_table/struct.Foo.html
44
size: (1100, 800)
55
// Logically, the ".docblock" and the "<p>" should have the same scroll width.
66
compare-elements-property: (".top-doc .docblock", ".top-doc .docblock > p", ["scrollWidth"])
7-
assert-property: (".top-doc .docblock", {"scrollWidth": "801"})
7+
assert-property: (".top-doc .docblock", {"scrollWidth": "816"})
88
// However, since there is overflow in the <table>, its scroll width is bigger.
99
assert-property: (".top-doc .docblock table", {"scrollWidth": "1572"})
1010

@@ -16,6 +16,6 @@ compare-elements-property: (
1616
"#implementations-list > details .docblock > p",
1717
["scrollWidth"],
1818
)
19-
assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "801"})
19+
assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "816"})
2020
// However, since there is overflow in the <table>, its scroll width is bigger.
2121
assert-property: ("#implementations-list > details .docblock table", {"scrollWidth": "1572"})

src/test/rustdoc-gui/item-info-overflow.goml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ goto: file://|DOC_PATH|/lib2/struct.LongItemInfo.html
44
size: (1200, 870)
55
// Logically, the "item-decl" and the "item-info" should have the same scroll width.
66
compare-elements-property: (".item-decl", ".item-info", ["scrollWidth"])
7-
assert-property: (".item-info", {"scrollWidth": "890"})
7+
assert-property: (".item-info", {"scrollWidth": "940"})
88
// Just to be sure we're comparing the correct "item-info":
99
assert-text: (
1010
".item-info",
@@ -21,7 +21,7 @@ compare-elements-property: (
2121
)
2222
assert-property: (
2323
"#impl-SimpleTrait-for-LongItemInfo2 .item-info",
24-
{"scrollWidth": "866"},
24+
{"scrollWidth": "916"},
2525
)
2626
// Just to be sure we're comparing the correct "item-info":
2727
assert-text: (

src/test/rustdoc-gui/item-info.goml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ goto: file://|DOC_PATH|/lib2/struct.Foo.html
44
// We set a fixed size so there is no chance of "random" resize.
55
size: (1100, 800)
66
// We check that ".item-info" is bigger than its content.
7-
assert-css: (".item-info", {"width": "790px"})
7+
assert-css: (".item-info", {"width": "840px"})
88
assert-css: (".item-info .stab", {"width": "289px"})
9-
assert-position: (".item-info .stab", {"x": 295})
9+
assert-position: (".item-info .stab", {"x": 245})
1010

1111
// Now we ensure that they're not rendered on the same line.
1212
goto: file://|DOC_PATH|/lib2/trait.Trait.html

src/test/rustdoc-gui/notable-trait.goml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ compare-elements-position-false: (
1818
// The `i` should be *after* the type.
1919
assert-position: (
2020
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
21-
{"x": 692},
21+
{"x": 677},
2222
)
2323
assert-position: (
2424
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
25-
{"x": 966},
25+
{"x": 951},
2626
)
2727

2828

src/test/rustdoc-gui/search-result-display.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ press-key: 'Enter'
77
wait-for: "#crate-search"
88
// The width is returned by "getComputedStyle" which returns the exact number instead of the
99
// CSS rule which is "50%"...
10-
assert-css: (".search-results div.desc", {"width": "293px"})
10+
assert-css: (".search-results div.desc", {"width": "318px"})
1111
size: (600, 100)
1212
// As counter-intuitive as it may seem, in this width, the width is "100%", which is why
1313
// when computed it's larger.

src/test/rustdoc-gui/type-declation-overflow.goml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ assert-property: (".item-table .struct", {"offsetWidth": "684"})
1515
goto: file://|DOC_PATH|/lib2/too_long/type.ReallyLongTypeNameLongLongLong.html
1616
assert-property: ("body", {"scrollWidth": "1100"})
1717
// We now check that the section width hasn't grown because of it.
18-
assert-property: ("#main-content", {"scrollWidth": "825"})
18+
assert-property: ("#main-content", {"scrollWidth": "840"})
1919
// And now checking that it has scrollable content.
2020
assert-property: (".item-decl pre", {"scrollWidth": "1103"})
2121

@@ -24,7 +24,7 @@ assert-property: (".item-decl pre", {"scrollWidth": "1103"})
2424
goto: file://|DOC_PATH|/lib2/too_long/constant.ReallyLongTypeNameLongLongLongConstBecauseWhyNotAConstRightGigaGigaSupraLong.html
2525
assert-property: ("body", {"scrollWidth": "1100"})
2626
// We now check that the section width hasn't grown because of it.
27-
assert-property: ("#main-content", {"scrollWidth": "825"})
27+
assert-property: ("#main-content", {"scrollWidth": "840"})
2828
// And now checking that it has scrollable content.
2929
assert-property: (".item-decl pre", {"scrollWidth": "950"})
3030

0 commit comments

Comments
 (0)