1
Fork 0

Add a test to detect overlapping entries in overview tables

Detects https://github.com/rust-lang/rust/issues/88545
This commit is contained in:
Stefan Schindler 2021-09-10 13:40:38 +02:00 committed by Mark Rousskov
parent 2801a770ce
commit a0cc9bb0f6
4 changed files with 26 additions and 0 deletions

View 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})

View file

@ -3,5 +3,7 @@ name = "test_docs"
version = "0.1.0"
edition = "2018"
build = "build.rs"
[lib]
path = "lib.rs"

View 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)
}

View file

@ -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"));
}