Skip to content

Commit 3f1a120

Browse files
Add GUI test for <table> overflow
1 parent b0f8776 commit 3f1a120

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This test ensures that the type declaration content overflow is handled inside the <pre> directly.
2+
goto: file://|DOC_PATH|/lib2/long_table/struct.Foo.html
3+
// We set a fixed size so there is no chance of "random" resize.
4+
size: (1100, 800)
5+
// Logically, the ".docblock" and the "<p>" should have the same scroll width.
6+
compare-elements-property: (".top-doc .docblock", ".top-doc .docblock > p", ["scrollWidth"])
7+
assert-property: (".top-doc .docblock", {"scrollWidth": "816"})
8+
// However, since there is overflow in the <table>, its scroll width is bigger.
9+
assert-property: (".top-doc .docblock table", {"scrollWidth": "1573"})

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

+9
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,12 @@ pub mod long_trait {
5454
pub trait ALongNameBecauseItHelpsTestingTheCurrentProblem: DerefMut<Target = u32>
5555
+ From<u128> + Send + Sync + AsRef<str> + 'static {}
5656
}
57+
58+
pub mod long_table {
59+
/// | 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 |
60+
/// | ----------- | ----------- | ----------- | ----------- |
61+
/// | 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 |
62+
///
63+
/// 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
64+
pub struct Foo;
65+
}

0 commit comments

Comments
 (0)