Skip to content

Commit

Permalink
Add GUI regression test for rust-lang#130622 and for rust-lang#131223
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 4, 2024
1 parent e5ffccd commit 33e7fae
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/rustdoc-gui/list-margins.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// 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

// 0.3em
assert-css: (".docblock li p:not(last-child)", {"margin-bottom": "4.8px"})
assert-css: (".docblock li p + p:last-child", {"margin-bottom": "0px"})
// 0.4em
assert-css: (".docblock li", {"margin-bottom": "6.4px"})
24 changes: 24 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,27 @@ pub mod short_docs {
/// subt_vec_num(x: &[f64], y: f64)
pub fn subt_vec_num() {}
}

pub mod long_list {
//! bla
//!
//! * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque et libero ut leo
//! interdum laoreet vitae a mi. Aliquam erat volutpat. Suspendisse volutpat non quam non
//! commodo.
//!
//! Praesent enim neque, imperdiet sed nisl at, lobortis egestas augue. Sed vitae tristique
//! augue. Phasellus vel pretium lectus.
//! * Praesent enim neque, imperdiet sed nisl at, lobortis egestas augue. Sed vitae tristique
//! augue. Phasellus vel pretium lectus.
//! * Praesent enim neque, imperdiet sed nisl at, lobortis egestas augue. Sed vitae tristique
//! augue. Phasellus vel pretium lectus.
//!
//! Another list:
//!
//! * [`TryFromBytes`](#a) indicates that a type may safely be converted from certain byte
//! sequence (conditional on runtime checks)
//! * [`FromZeros`](#a) indicates that a sequence of zero bytes represents a valid instance of
//! a type
//! * [`FromBytes`](#a) indicates that a type may safely be converted from an arbitrary byte
//! sequence
}

0 comments on commit 33e7fae

Please sign in to comment.