Skip to content

Commit

Permalink
Add GUI test for <table> overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jul 17, 2021
1 parent b0f8776 commit 3f1a120
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/rustdoc-gui/docblock-table-overflow.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This test ensures that the type declaration content overflow is handled inside the <pre> directly.
goto: file://|DOC_PATH|/lib2/long_table/struct.Foo.html
// We set a fixed size so there is no chance of "random" resize.
size: (1100, 800)
// Logically, the ".docblock" and the "<p>" should have the same scroll width.
compare-elements-property: (".top-doc .docblock", ".top-doc .docblock > p", ["scrollWidth"])
assert-property: (".top-doc .docblock", {"scrollWidth": "816"})
// However, since there is overflow in the <table>, its scroll width is bigger.
assert-property: (".top-doc .docblock table", {"scrollWidth": "1573"})
9 changes: 9 additions & 0 deletions src/test/rustdoc-gui/src/lib2/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,12 @@ pub mod long_trait {
pub trait ALongNameBecauseItHelpsTestingTheCurrentProblem: DerefMut<Target = u32>
+ From<u128> + Send + Sync + AsRef<str> + 'static {}
}

pub mod long_table {
/// | This::is::a::kinda::very::long::header::number::one | This::is::a::kinda::very::long::header::number::two | This::is::a::kinda::very::long::header::number::one | This::is::a::kinda::very::long::header::number::two |
/// | ----------- | ----------- | ----------- | ----------- |
/// | This::is::a::kinda::long::content::number::one | This::is::a::kinda::very::long::content::number::two | This::is::a::kinda::long::content::number::one | This::is::a::kinda::very::long::content::number::two |
///
/// I wanna sqdkfnqds f dsqf qds f dsqf dsq f dsq f qds f qds f qds f dsqq f dsf sqdf dsq fds f dsq f dq f ds fq sd fqds f dsq f sqd fsq df sd fdsqfqsd fdsq f dsq f dsqfd s dfq
pub struct Foo;
}

0 comments on commit 3f1a120

Please sign in to comment.