Skip to content

Commit 25e7403

Browse files
Add regression test for type declaration layout overflow
1 parent 59103d1 commit 25e7403

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,10 @@ pub mod sub_mod {
4747
/// ```
4848
pub struct Foo;
4949
}
50+
51+
pub mod long_trait {
52+
use std::ops::DerefMut;
53+
54+
pub trait ALongNameBecauseItHelpsTestingTheCurrentProblem: DerefMut<Target = u32>
55+
+ From<u128> + Send + Sync + AsRef<str> + 'static {}
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This test ensures that the type declaration content overflow is handled inside the <pre> directly.
2+
goto: file://|DOC_PATH|/lib2/long_trait/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.html
3+
// We set a fixed size so there is no chance of "random" resize.
4+
size: (1100, 800)
5+
// Logically, the <body> scroll width should be the width of the window.
6+
assert-property: ("body", {"scrollWidth": "1100"})
7+
// However, since there is overflow in the type declaration, its scroll width is bigger.
8+
assert-property: (".type-decl pre", {"scrollWidth": "1324"})

0 commit comments

Comments
 (0)