Skip to content

Commit

Permalink
Fix test cases for header titles in sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle authored and pietroalbini committed Jul 26, 2021
1 parent e64f994 commit 1e01a14
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/test/rustdoc/deref-typedef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_b"]' 'pub fn foo_b(&self)'
// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_c"]' 'pub fn foo_c(&self)'
// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_j"]' 'pub fn foo_j(&self)'
// @has '-' '//*[@class="sidebar-title"][@href="#deref-methods"]' 'Methods from Deref<Target=FooJ>'
// @has '-' '//*[@class="sidebar-title"]/a[@href="#deref-methods"]' 'Methods from Deref<Target=FooJ>'
// @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_a"]' 'foo_a'
// @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_b"]' 'foo_b'
// @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_c"]' 'foo_c'
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc/negative-impl-sidebar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
pub struct Foo;

// @has foo/struct.Foo.html
// @has - '//*[@class="sidebar-title"][@href="#trait-implementations"]' 'Trait Implementations'
// @has - '//*[@class="sidebar-title"]/a[@href="#trait-implementations"]' 'Trait Implementations'
// @has - '//*[@class="sidebar-links"]/a' '!Sync'
impl !Sync for Foo {}
14 changes: 7 additions & 7 deletions src/test/rustdoc/sidebar-items.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#![crate_name = "foo"]

// @has foo/trait.Foo.html
// @has - '//*[@class="sidebar-title"][@href="#required-methods"]' 'Required Methods'
// @has - '//*[@class="sidebar-title"]/a[@href="#required-methods"]' 'Required Methods'
// @has - '//*[@class="sidebar-links"]/a' 'bar'
// @has - '//*[@class="sidebar-title"][@href="#provided-methods"]' 'Provided Methods'
// @has - '//*[@class="sidebar-title"]/a[@href="#provided-methods"]' 'Provided Methods'
// @has - '//*[@class="sidebar-links"]/a' 'foo'
// @has - '//*[@class="sidebar-title"][@href="#associated-const"]' 'Associated Constants'
// @has - '//*[@class="sidebar-title"]/a[@href="#associated-const"]' 'Associated Constants'
// @has - '//*[@class="sidebar-links"]/a' 'BAR'
// @has - '//*[@class="sidebar-title"][@href="#associated-types"]' 'Associated Types'
// @has - '//*[@class="sidebar-title"]/a[@href="#associated-types"]' 'Associated Types'
// @has - '//*[@class="sidebar-links"]/a' 'Output'
pub trait Foo {
const BAR: u32 = 0;
Expand All @@ -18,7 +18,7 @@ pub trait Foo {
}

// @has foo/struct.Bar.html
// @has - '//*[@class="sidebar-title"][@href="#fields"]' 'Fields'
// @has - '//*[@class="sidebar-title"]/a[@href="#fields"]' 'Fields'
// @has - '//*[@class="sidebar-links"]/a[@href="#structfield.f"]' 'f'
// @has - '//*[@class="sidebar-links"]/a[@href="#structfield.u"]' 'u'
// @!has - '//*[@class="sidebar-links"]/a' 'waza'
Expand All @@ -29,7 +29,7 @@ pub struct Bar {
}

// @has foo/enum.En.html
// @has - '//*[@class="sidebar-title"][@href="#variants"]' 'Variants'
// @has - '//*[@class="sidebar-title"]/a[@href="#variants"]' 'Variants'
// @has - '//*[@class="sidebar-links"]/a' 'foo'
// @has - '//*[@class="sidebar-links"]/a' 'bar'
pub enum En {
Expand All @@ -38,7 +38,7 @@ pub enum En {
}

// @has foo/union.MyUnion.html
// @has - '//*[@class="sidebar-title"][@href="#fields"]' 'Fields'
// @has - '//*[@class="sidebar-title"]/a[@href="#fields"]' 'Fields'
// @has - '//*[@class="sidebar-links"]/a[@href="#structfield.f1"]' 'f1'
// @has - '//*[@class="sidebar-links"]/a[@href="#structfield.f2"]' 'f2'
// @!has - '//*[@class="sidebar-links"]/a' 'waza'
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc/sidebar-links-to-foreign-impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#![crate_name = "foo"]

// @has foo/trait.Foo.html
// @has - '//*[@class="sidebar-title"][@href="#foreign-impls"]' 'Implementations on Foreign Types'
// @has - '//*[@class="sidebar-title"]/a[@href="#foreign-impls"]' 'Implementations on Foreign Types'
// @has - '//h2[@id="foreign-impls"]' 'Implementations on Foreign Types'
// @has - '//*[@class="sidebar-links"]/a[@href="#impl-Foo-for-u32"]' 'u32'
// @has - '//div[@id="impl-Foo-for-u32"]//code' 'impl Foo for u32'
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc/typedef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl MyStruct {
// @has - '//*[@class="impl has-srclink"]//code' 'impl MyAlias'
// @has - '//*[@class="impl has-srclink"]//code' 'impl MyTrait for MyAlias'
// @has - 'Alias docstring'
// @has - '//*[@class="sidebar"]//p[@class="location"]' 'Type Definition MyAlias'
// @has - '//*[@class="sidebar"]//*[@class="location"]' 'Type Definition MyAlias'
// @has - '//*[@class="sidebar"]//a[@href="#implementations"]' 'Methods'
// @has - '//*[@class="sidebar"]//a[@href="#trait-implementations"]' 'Trait Implementations'
/// Alias docstring
Expand Down

0 comments on commit 1e01a14

Please sign in to comment.