Skip to content

Commit c820a23

Browse files
Add test for size of items in the items list
1 parent fed0592 commit c820a23

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ pub mod too_long {
117117
pub type ReallyLongTypeNameLongLongLong =
118118
Option<unsafe extern "C" fn(a: *const u8, b: *const u8) -> *const u8>;
119119

120+
/// Short doc.
120121
pub const ReallyLongTypeNameLongLongLongConstBecauseWhyNotAConstRightGigaGigaSupraLong: u32 = 0;
121122

122123
/// This also has a really long doccomment. Lorem ipsum dolor sit amet,

tests/rustdoc-gui/type-declation-overflow.goml

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ assert-property: ("pre.item-decl", {"scrollWidth": "1324"})
1616

1717
// In the table-ish view on the module index, the name should not be wrapped more than necessary.
1818
go-to: "file://" + |DOC_PATH| + "/lib2/too_long/index.html"
19-
assert-property: (".item-table .struct", {"offsetWidth": "684"})
19+
20+
// We'll ensure that items with short documentation have the same width.
21+
store-property: ("//*[@class='item-table']//*[@class='struct']/..", {"offsetWidth": offset_width})
22+
assert: |offset_width| == "277"
23+
assert-property: ("//*[@class='item-table']//*[@class='constant']/..", {"offsetWidth": |offset_width|})
2024

2125
// We now make the same check on type declaration...
2226
go-to: "file://" + |DOC_PATH| + "/lib2/too_long/type.ReallyLongTypeNameLongLongLong.html"

0 commit comments

Comments
 (0)