2022-08-31 16:13:59 +00:00
|
|
|
// This test ensures that the where conditions are correctly displayed.
|
2023-04-11 17:11:34 +00:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/lib2/trait.Whitespace.html"
|
2022-08-31 16:13:59 +00:00
|
|
|
show-text: true
|
|
|
|
// First, we check in the trait definition if the where clause is "on its own" (not on the same
|
|
|
|
// line than "pub trait Whitespace<Idx>").
|
|
|
|
compare-elements-position-false: (".item-decl code", ".where.fmt-newline", ("y"))
|
|
|
|
// And that the code following it isn't on the same line either.
|
2022-11-28 17:21:19 +00:00
|
|
|
compare-elements-position-false: (".item-decl .fn", ".where.fmt-newline", ("y"))
|
2022-08-31 16:13:59 +00:00
|
|
|
|
2023-04-11 17:11:34 +00:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/lib2/struct.WhereWhitespace.html"
|
2022-08-31 16:13:59 +00:00
|
|
|
// We make the screen a bit wider to ensure that the trait impl is on one line.
|
2023-04-11 17:11:34 +00:00
|
|
|
set-window-size: (915, 915)
|
2022-08-31 16:13:59 +00:00
|
|
|
|
2022-11-28 17:21:19 +00:00
|
|
|
compare-elements-position-false: ("#method\.new .fn", "#method\.new .where.fmt-newline", ("y"))
|
2022-08-31 16:13:59 +00:00
|
|
|
// We ensure that both the trait name and the struct name are on the same line in
|
|
|
|
// "impl<K, T> Whitespace<&K> for WhereWhitespace<T>".
|
|
|
|
compare-elements-position: (
|
|
|
|
"#trait-implementations-list .impl h3 .trait",
|
|
|
|
"#trait-implementations-list .impl h3 .struct",
|
|
|
|
("y"),
|
|
|
|
)
|
|
|
|
// And we now check that the where condition isn't on the same line.
|
|
|
|
compare-elements-position-false: (
|
|
|
|
"#trait-implementations-list .impl h3 .trait",
|
|
|
|
"#trait-implementations-list .impl h3 .where.fmt-newline",
|
|
|
|
("y"),
|
|
|
|
)
|