Skip to content

Commit

Permalink
Add GUI regression test for rust-lang#130622
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 3, 2024
1 parent 9e3e517 commit eed861e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/rustdoc-gui/list-marker.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// This test ensures that the documentation list markers are correctly placed.
// It also serves as a regression test for <https://github.com/rust-lang/rust/issues/130622>.

go-to: "file://" + |DOC_PATH| + "/test_docs/long_list/index.html"
show-text: true
define-function: (
"check_pos",
[nb],
block {
compare-elements-position: (
".top-doc .docblock ul li:nth-child(" + |nb| + ")",
".top-doc .docblock ul li:nth-child(" + |nb| + ")::marker",
["y"],
)
},
)

call-function: ("check_pos", {"nb": 1})
call-function: ("check_pos", {"nb": 2})
call-function: ("check_pos", {"nb": 3})
call-function: ("check_pos", {"nb": 4})
17 changes: 17 additions & 0 deletions tests/rustdoc-gui/src/test_docs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,3 +628,20 @@ pub mod short_docs {
/// subt_vec_num(x: &[f64], y: f64)
pub fn subt_vec_num() {}
}

pub mod long_list {
//! bla
//!
//! * `alloc`
//!
//! Small bla bla bla bla bla bla bla bla.
//! * `macros`
//!
//! Small bla bla bla bla bla bla bla bla.
//! * `std` (why not)
//!
//! Small bla bla bla bla bla bla bla bla.
//! * `local` (yep)
//!
//! Small bla bla bla bla bla bla bla bla.
}

0 comments on commit eed861e

Please sign in to comment.