Skip to content

Commit

Permalink
Add test for size of items in the items list
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jul 18, 2024
1 parent fed0592 commit c820a23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/rustdoc-gui/src/lib2/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ pub mod too_long {
pub type ReallyLongTypeNameLongLongLong =
Option<unsafe extern "C" fn(a: *const u8, b: *const u8) -> *const u8>;

/// Short doc.
pub const ReallyLongTypeNameLongLongLongConstBecauseWhyNotAConstRightGigaGigaSupraLong: u32 = 0;

/// This also has a really long doccomment. Lorem ipsum dolor sit amet,
Expand Down
6 changes: 5 additions & 1 deletion tests/rustdoc-gui/type-declation-overflow.goml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ assert-property: ("pre.item-decl", {"scrollWidth": "1324"})

// In the table-ish view on the module index, the name should not be wrapped more than necessary.
go-to: "file://" + |DOC_PATH| + "/lib2/too_long/index.html"
assert-property: (".item-table .struct", {"offsetWidth": "684"})

// We'll ensure that items with short documentation have the same width.
store-property: ("//*[@class='item-table']//*[@class='struct']/..", {"offsetWidth": offset_width})
assert: |offset_width| == "277"
assert-property: ("//*[@class='item-table']//*[@class='constant']/..", {"offsetWidth": |offset_width|})

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

0 comments on commit c820a23

Please sign in to comment.