forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression test for rust-lang#111415
- Loading branch information
1 parent
88493d2
commit 0f1d4b5
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Regression test for <https://github.com/rust-lang/rust/issues/111415>. | ||
// This test ensures that only impl blocks are documented in bodies. | ||
|
||
#![crate_name = "foo"] | ||
|
||
// @has 'foo/index.html' | ||
// Checking there are only three sections. | ||
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 3 | ||
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Structs' | ||
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Functions' | ||
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Traits' | ||
// Checking that there are only three items. | ||
// @count - '//*[@id="main-content"]//*[@class="item-name"]' 3 | ||
// @has - '//*[@id="main-content"]//a[@href="struct.Bar.html"]' 'Bar' | ||
// @has - '//*[@id="main-content"]//a[@href="fn.foo.html"]' 'foo' | ||
// @has - '//*[@id="main-content"]//a[@href="trait.Foo.html"]' 'Foo' | ||
|
||
// Now checking that the `foo` method is visible in `Bar` page. | ||
// @has 'foo/struct.Bar.html' | ||
// @has - '//*[@id="method.foo"]/*[@class="code-header"]' 'pub fn foo()' | ||
// @has - '//*[@id="method.bar"]/*[@class="code-header"]' 'fn bar()' | ||
pub struct Bar; | ||
|
||
pub trait Foo { | ||
fn bar() {} | ||
} | ||
|
||
pub fn foo() { | ||
pub mod inaccessible {} | ||
pub fn inner() {} | ||
pub const BAR: u32 = 0; | ||
impl Bar { | ||
pub fn foo() {} | ||
} | ||
impl Foo for Bar {} | ||
} |