]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/type-declation-overflow.goml
Rollup merge of #101166 - GuillaumeGomez:error-index-mdbook, r=notriddle
[rust.git] / src / test / rustdoc-gui / type-declation-overflow.goml
1 // This test ensures that the items declaration content overflow is handled inside the <pre> directly.
2 goto: file://|DOC_PATH|/lib2/long_trait/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.html
3 // We set a fixed size so there is no chance of "random" resize.
4 size: (1100, 800)
5 // Logically, the <body> scroll width should be the width of the window.
6 assert-property: ("body", {"scrollWidth": "1100"})
7 // However, since there is overflow in the type declaration, its scroll width is bigger.
8 assert-property: (".item-decl pre", {"scrollWidth": "1324"})
9
10 // In the table-ish view on the module index, the name should not be wrapped more than necessary.
11 goto: file://|DOC_PATH|/lib2/too_long/index.html
12 assert-property: (".item-table .struct", {"offsetWidth": "684"})
13
14 // We now make the same check on type declaration...
15 goto: file://|DOC_PATH|/lib2/too_long/type.ReallyLongTypeNameLongLongLong.html
16 assert-property: ("body", {"scrollWidth": "1100"})
17 // We now check that the section width hasn't grown because of it.
18 assert-property: ("#main-content", {"scrollWidth": "825"})
19 // And now checking that it has scrollable content.
20 assert-property: (".item-decl pre", {"scrollWidth": "1103"})
21
22 // ... and constant.
23 // On a sidenote, it also checks that the (very) long title isn't changing the docblock width.
24 goto: file://|DOC_PATH|/lib2/too_long/constant.ReallyLongTypeNameLongLongLongConstBecauseWhyNotAConstRightGigaGigaSupraLong.html
25 assert-property: ("body", {"scrollWidth": "1100"})
26 // We now check that the section width hasn't grown because of it.
27 assert-property: ("#main-content", {"scrollWidth": "825"})
28 // And now checking that it has scrollable content.
29 assert-property: (".item-decl pre", {"scrollWidth": "950"})
30
31 // On mobile:
32 size: (600, 600)
33 goto: file://|DOC_PATH|/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html
34 // It shouldn't have an overflow in the topbar either.
35 assert-property: (".mobile-topbar .location", {"scrollWidth": "502"})
36 assert-property: (".mobile-topbar .location", {"clientWidth": "502"})
37 assert-css: (".mobile-topbar .location", {"overflow-x": "hidden"})