Skip to content

Commit 8e6cf7d

Browse files
committed
rustdoc: update test cases for changed item-decl HTML
1 parent 9457380 commit 8e6cf7d

25 files changed

+72
-72
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This test ensures that the docblock elements have the appropriate left margin.
22
goto: file://|DOC_PATH|/test_docs/fn.foo.html
33
// The top docblock elements shouldn't have left margin...
4-
assert-css: ("#main-content .docblock.item-decl", {"margin-left": "0px"})
4+
assert-css: ("#main-content .item-decl", {"margin-left": "0px"})
55
// ... but all the others should!
6-
assert-css: ("#main-content .docblock:not(.item-decl)", {"margin-left": "24px"})
6+
assert-css: ("#main-content .docblock", {"margin-left": "24px"})

src/test/rustdoc-gui/font-weight.goml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This test checks that the font weight is correctly applied.
22
goto: file://|DOC_PATH|/lib2/struct.Foo.html
3-
assert-css: ("//*[@class='docblock item-decl']//a[text()='Alias']", {"font-weight": "400"})
3+
assert-css: ("//*[@class='item-decl']//a[text()='Alias']", {"font-weight": "400"})
44
assert-css: (
55
"//*[@class='structfield small-section-header']//a[text()='Alias']",
66
{"font-weight": "400"},
@@ -19,7 +19,7 @@ goto: file://|DOC_PATH|/lib2/trait.Trait.html
1919

2020
// This is a complex selector, so here's how it works:
2121
//
22-
// * //*[@class='docblock item-decl'] — selects element of any tag with classes docblock and item-decl
22+
// * //*[@class='item-decl'] — selects element of any tag with classes docblock and item-decl
2323
// * /pre[@class='rust trait'] — selects immediate child with tag pre and classes rust and trait
2424
// * /code — selects immediate child with tag code
2525
// * /a[@class='constant'] — selects immediate child with tag a and class constant
@@ -29,11 +29,11 @@ goto: file://|DOC_PATH|/lib2/trait.Trait.html
2929
// This uses '/parent::*' as a proxy for the style of the text node.
3030
// We can't just select the '<a>' because intermediate tags could be added.
3131
assert-count: (
32-
"//*[@class='docblock item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
32+
"//*[@class='item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
3333
1,
3434
)
3535
assert-css: (
36-
"//*[@class='docblock item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
36+
"//*[@class='item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
3737
{"font-weight": "400"},
3838
)
3939

src/test/rustdoc-gui/item-info-overflow.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ goto: file://|DOC_PATH|/lib2/struct.LongItemInfo.html
33
// We set a fixed size so there is no chance of "random" resize.
44
size: (1200, 870)
55
// Logically, the "item-decl" and the "item-info" should have the same scroll width.
6-
compare-elements-property: (".docblock.item-decl", ".item-info", ["scrollWidth"])
6+
compare-elements-property: (".item-decl", ".item-info", ["scrollWidth"])
77
assert-property: (".item-info", {"scrollWidth": "890"})
88
// Just to be sure we're comparing the correct "item-info":
99
assert-text: (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![crate_name = "foo"]
22

33
// @has 'foo/fn.f.html'
4-
// @has - //*[@'class="docblock item-decl"]' '#[export_name = "f"] pub fn f()'
4+
// @has - //*[@'class="item-decl"]' '#[export_name = "f"] pub fn f()'
55
#[export_name = "\
66
f"]
77
pub fn f() {}

src/test/rustdoc/attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ pub extern "C" fn f() {}
88
#[export_name = "bar"]
99
pub extern "C" fn g() {}
1010

11-
// @has foo/struct.Repr.html '//*[@class="docblock item-decl"]' '#[repr(C, align(8))]'
11+
// @has foo/struct.Repr.html '//*[@class="item-decl"]' '#[repr(C, align(8))]'
1212
#[repr(C, align(8))]
1313
pub struct Repr;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#![crate_name = "foo"]
22

33
// @has 'foo/constant.HOUR_IN_SECONDS.html'
4-
// @has - '//*[@class="docblock item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = _; // 3_600u64'
4+
// @has - '//*[@class="item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = _; // 3_600u64'
55
pub const HOUR_IN_SECONDS: u64 = 60 * 60;
66

77
// @has 'foo/constant.NEGATIVE.html'
8-
// @has - '//*[@class="docblock item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64'
8+
// @has - '//*[@class="item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64'
99
pub const NEGATIVE: i64 = -60 * 60;

src/test/rustdoc/decl-trailing-whitespace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub struct Error;
77
// @has 'foo/trait.Write.html'
88

99
pub trait Write {
10-
// @snapshot 'declaration' - '//*[@class="docblock item-decl"]//code'
10+
// @snapshot 'declaration' - '//*[@class="item-decl"]//code'
1111
fn poll_write(
1212
self: Option<String>,
1313
cx: &mut Option<String>,

src/test/rustdoc/macro-higher-kinded-function.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ macro_rules! gen {
1111
}
1212

1313
// @has 'foo/struct.Providers.html'
14-
// @has - '//*[@class="docblock item-decl"]//code' "pub a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8,"
15-
// @has - '//*[@class="docblock item-decl"]//code' "pub b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16,"
14+
// @has - '//*[@class="item-decl"]//code' "pub a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8,"
15+
// @has - '//*[@class="item-decl"]//code' "pub b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16,"
1616
// @has - '//*[@id="structfield.a"]/code' "a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8"
1717
// @has - '//*[@id="structfield.b"]/code' "b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16"
1818
gen! {

src/test/rustdoc/reexport-dep-foreign-fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
extern crate all_item_types;
99

1010
// @has 'foo/fn.foo_ffn.html'
11-
// @has - '//*[@class="docblock item-decl"]//code' 'pub unsafe extern "C" fn foo_ffn()'
11+
// @has - '//*[@class="item-decl"]//code' 'pub unsafe extern "C" fn foo_ffn()'
1212
pub use all_item_types::foo_ffn;

src/test/rustdoc/reexports-priv.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
extern crate reexports;
77

8-
// @has 'foo/macro.addr_of.html' '//*[@class="docblock item-decl"]' 'pub macro addr_of($place:expr) {'
8+
// @has 'foo/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
99
pub use reexports::addr_of;
1010
// @!has 'foo/macro.addr_of_crate.html'
1111
pub(crate) use reexports::addr_of_crate;
@@ -14,7 +14,7 @@ pub(self) use reexports::addr_of_self;
1414
// @!has 'foo/macro.addr_of_local.html'
1515
use reexports::addr_of_local;
1616

17-
// @has 'foo/struct.Foo.html' '//*[@class="docblock item-decl"]' 'pub struct Foo;'
17+
// @has 'foo/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
1818
pub use reexports::Foo;
1919
// @!has 'foo/struct.FooCrate.html'
2020
pub(crate) use reexports::FooCrate;
@@ -23,7 +23,7 @@ pub(self) use reexports::FooSelf;
2323
// @!has 'foo/struct.FooLocal.html'
2424
use reexports::FooLocal;
2525

26-
// @has 'foo/enum.Bar.html' '//*[@class="docblock item-decl"]' 'pub enum Bar {'
26+
// @has 'foo/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
2727
pub use reexports::Bar;
2828
// @!has 'foo/enum.BarCrate.html'
2929
pub(crate) use reexports::BarCrate;
@@ -50,7 +50,7 @@ pub(self) use reexports::TypeSelf;
5050
// @!has 'foo/type.TypeLocal.html'
5151
use reexports::TypeLocal;
5252

53-
// @has 'foo/union.Union.html' '//*[@class="docblock item-decl"]' 'pub union Union {'
53+
// @has 'foo/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
5454
pub use reexports::Union;
5555
// @!has 'foo/union.UnionCrate.html'
5656
pub(crate) use reexports::UnionCrate;
@@ -61,33 +61,33 @@ use reexports::UnionLocal;
6161

6262
pub mod outer {
6363
pub mod inner {
64-
// @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="docblock item-decl"]' 'pub macro addr_of($place:expr) {'
64+
// @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
6565
pub use reexports::addr_of;
66-
// @has 'foo/outer/inner/macro.addr_of_crate.html' '//*[@class="docblock item-decl"]' 'pub(crate) macro addr_of_crate($place:expr) {'
66+
// @has 'foo/outer/inner/macro.addr_of_crate.html' '//*[@class="item-decl"]' 'pub(crate) macro addr_of_crate($place:expr) {'
6767
pub(crate) use reexports::addr_of_crate;
68-
// @has 'foo/outer/inner/macro.addr_of_super.html' '//*[@class="docblock item-decl"]' 'pub(in outer) macro addr_of_super($place:expr) {'
68+
// @has 'foo/outer/inner/macro.addr_of_super.html' '//*[@class="item-decl"]' 'pub(in outer) macro addr_of_super($place:expr) {'
6969
pub(super) use reexports::addr_of_super;
7070
// @!has 'foo/outer/inner/macro.addr_of_self.html'
7171
pub(self) use reexports::addr_of_self;
7272
// @!has 'foo/outer/inner/macro.addr_of_local.html'
7373
use reexports::addr_of_local;
7474

75-
// @has 'foo/outer/inner/struct.Foo.html' '//*[@class="docblock item-decl"]' 'pub struct Foo;'
75+
// @has 'foo/outer/inner/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
7676
pub use reexports::Foo;
77-
// @has 'foo/outer/inner/struct.FooCrate.html' '//*[@class="docblock item-decl"]' 'pub(crate) struct FooCrate;'
77+
// @has 'foo/outer/inner/struct.FooCrate.html' '//*[@class="item-decl"]' 'pub(crate) struct FooCrate;'
7878
pub(crate) use reexports::FooCrate;
79-
// @has 'foo/outer/inner/struct.FooSuper.html' '//*[@class="docblock item-decl"]' 'pub(in outer) struct FooSuper;'
79+
// @has 'foo/outer/inner/struct.FooSuper.html' '//*[@class="item-decl"]' 'pub(in outer) struct FooSuper;'
8080
pub(super) use reexports::FooSuper;
8181
// @!has 'foo/outer/inner/struct.FooSelf.html'
8282
pub(self) use reexports::FooSelf;
8383
// @!has 'foo/outer/inner/struct.FooLocal.html'
8484
use reexports::FooLocal;
8585

86-
// @has 'foo/outer/inner/enum.Bar.html' '//*[@class="docblock item-decl"]' 'pub enum Bar {'
86+
// @has 'foo/outer/inner/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
8787
pub use reexports::Bar;
88-
// @has 'foo/outer/inner/enum.BarCrate.html' '//*[@class="docblock item-decl"]' 'pub(crate) enum BarCrate {'
88+
// @has 'foo/outer/inner/enum.BarCrate.html' '//*[@class="item-decl"]' 'pub(crate) enum BarCrate {'
8989
pub(crate) use reexports::BarCrate;
90-
// @has 'foo/outer/inner/enum.BarSuper.html' '//*[@class="docblock item-decl"]' 'pub(in outer) enum BarSuper {'
90+
// @has 'foo/outer/inner/enum.BarSuper.html' '//*[@class="item-decl"]' 'pub(in outer) enum BarSuper {'
9191
pub(super) use reexports::BarSuper;
9292
// @!has 'foo/outer/inner/enum.BarSelf.html'
9393
pub(self) use reexports::BarSelf;
@@ -116,11 +116,11 @@ pub mod outer {
116116
// @!has 'foo/outer/inner/type.TypeLocal.html'
117117
use reexports::TypeLocal;
118118

119-
// @has 'foo/outer/inner/union.Union.html' '//*[@class="docblock item-decl"]' 'pub union Union {'
119+
// @has 'foo/outer/inner/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
120120
pub use reexports::Union;
121-
// @has 'foo/outer/inner/union.UnionCrate.html' '//*[@class="docblock item-decl"]' 'pub(crate) union UnionCrate {'
121+
// @has 'foo/outer/inner/union.UnionCrate.html' '//*[@class="item-decl"]' 'pub(crate) union UnionCrate {'
122122
pub(crate) use reexports::UnionCrate;
123-
// @has 'foo/outer/inner/union.UnionSuper.html' '//*[@class="docblock item-decl"]' 'pub(in outer) union UnionSuper {'
123+
// @has 'foo/outer/inner/union.UnionSuper.html' '//*[@class="item-decl"]' 'pub(in outer) union UnionSuper {'
124124
pub(super) use reexports::UnionSuper;
125125
// @!has 'foo/outer/inner/union.UnionSelf.html'
126126
pub(self) use reexports::UnionSelf;

0 commit comments

Comments
 (0)