Skip to content

Commit

Permalink
Add test to check width of item-info
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jul 18, 2021
1 parent d10703c commit 57f7501
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/rustdoc-gui/item-info-width.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This test ensures that the item information don't take 100% of the width if unnecessary.
goto: file://|DOC_PATH|/lib2/struct.Foo.html
// We set a fixed size so there is no chance of "random" resize.
size: (1100, 800)
// We check that ".item-info" is bigger than its content.
assert-css: (".item-info", {"width": "807px"})
assert-css: (".item-info .stab", {"width": "343px"})
3 changes: 3 additions & 0 deletions src/test/rustdoc-gui/src/lib2/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// ignore-tidy-linelength

#![feature(doc_cfg)]

pub mod module {
pub mod sub_module {
pub mod sub_sub_module {
Expand All @@ -14,6 +16,7 @@ pub fn foobar() {}

pub type Alias = u32;

#[doc(cfg(feature = "foo-method"))]
pub struct Foo {
pub x: Alias,
}
Expand Down

0 comments on commit 57f7501

Please sign in to comment.