Add a test to detect overlapping entries in overview tables
Detects https://github.com/rust-lang/rust/issues/88545
This commit is contained in:
parent
2801a770ce
commit
a0cc9bb0f6
4 changed files with 26 additions and 0 deletions
5
src/test/rustdoc-gui/huge-collection-of-constants.goml
Normal file
5
src/test/rustdoc-gui/huge-collection-of-constants.goml
Normal file
|
@ -0,0 +1,5 @@
|
|||
goto: file://|DOC_PATH|/test_docs/huge_amount_of_consts/index.html
|
||||
|
||||
// Make sure that the last two entries are more than 12 pixels apart and not stacked on each other.
|
||||
|
||||
compare-elements-position-near-false: ("//*[@class='item-table']//div[last()-1]", "//*[@class='item-table']//div[last()-3]", {"y": 12})
|
|
@ -3,5 +3,7 @@ name = "test_docs"
|
|||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
|
||||
build = "build.rs"
|
||||
|
||||
[lib]
|
||||
path = "lib.rs"
|
||||
|
|
15
src/test/rustdoc-gui/src/test_docs/build.rs
Normal file
15
src/test/rustdoc-gui/src/test_docs/build.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
//! generate 2000 constants for testing
|
||||
|
||||
use std::{fs::write, path::PathBuf};
|
||||
|
||||
fn main() -> std::io::Result<()> {
|
||||
let out_dir = std::env::var("OUT_DIR").expect("OUT_DIR is not defined");
|
||||
|
||||
let mut output = String::new();
|
||||
for i in 0..2000 {
|
||||
let line = format!("/// Some const A{0}\npub const A{0}: isize = 0;\n", i);
|
||||
output.push_str(&*line);
|
||||
};
|
||||
|
||||
write(&[&*out_dir, "huge_amount_of_consts.rs"].iter().collect::<PathBuf>(), output)
|
||||
}
|
|
@ -116,3 +116,7 @@ pub mod keyword {}
|
|||
|
||||
/// Just some type alias.
|
||||
pub type SomeType = u32;
|
||||
|
||||
pub mod huge_amount_of_consts {
|
||||
include!(concat!(env!("OUT_DIR"), "/huge_amount_of_consts.rs"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue