Skip to content

Commit 4850949

Browse files
authored
Unrolled build for rust-lang#128059
Rollup merge of rust-lang#128059 - GuillaumeGomez:test-for-128023, r=notriddle Add regression test for items list size (rust-lang#128023) Add missing regression test for rust-lang#128023. cc `@Kijewski` (if you want more information about the framework used, documentation is available [here](https://github.com/GuillaumeGomez/browser-UI-test/blob/master/goml-script.md)). r? `@notriddle`
2 parents 20f23ab + 7de2668 commit 4850949

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

tests/rustdoc-gui/item-name-wrap.goml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// This test ensures that the item name's width is not wrapped.
2+
go-to: "file://" + |DOC_PATH| + "/test_docs/short_docs/index.html"
3+
set-window-size: (1000, 600)
4+
5+
// First we ensure that there is only one `item-table`...
6+
assert-count: ("ul.item-table", 1)
7+
// And only two items in it.
8+
assert-count: ("ul.item-table li", 2)
9+
10+
// If they don't have the same height, then it means one of the two is on two lines whereas it
11+
// shouldn't!
12+
compare-elements-size: (
13+
".item-table .item-name a[href='fn.mult_vec_num.html']",
14+
".item-table .item-name a[href='fn.subt_vec_num.html']",
15+
["height"],
16+
)
17+
18+
// We also check that the `item-table` is taking the full width.
19+
compare-elements-size: (
20+
"#functions",
21+
"ul.item-table",
22+
["width"],
23+
)

tests/rustdoc-gui/src/test_docs/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -620,3 +620,11 @@ pub mod trait_bounds {
620620
pub trait TwoBounds: Sized + Copy {}
621621
pub trait ThreeBounds: Sized + Copy + Eq {}
622622
}
623+
624+
pub mod short_docs {
625+
/// mult_vec_num(x: &[f64], y: f64)
626+
pub fn mult_vec_num() {}
627+
628+
/// subt_vec_num(x: &[f64], y: f64)
629+
pub fn subt_vec_num() {}
630+
}

0 commit comments

Comments
 (0)