Skip to content

Commit 08a4f24

Browse files
author
Mukund Lakshman
committed
Add tests for ensuring docblock headings.
1 parent f1425c7 commit 08a4f24

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#![crate_name = "foo"]
2+
3+
// @has foo/trait.Read.html
4+
// @has - '//h2' 'Trait examples'
5+
/// # Trait examples
6+
pub trait Read {
7+
// @has - '//h5' 'Function examples'
8+
/// # Function examples
9+
fn read(&mut self, buf: &mut [u8]) -> Result<usize, ()>;
10+
}
11+
12+
pub struct Foo;
13+
14+
// @has foo/struct.Foo.html
15+
impl Foo {
16+
// @has - '//h5' 'Implementation header'
17+
/// # Implementation header
18+
pub fn bar(&self) -> usize {
19+
1
20+
}
21+
}
22+
23+
impl Read for Foo {
24+
// @has - '//h5' 'Trait implementation header'
25+
/// # Trait implementation header
26+
fn read(&mut self, buf: &mut [u8]) -> Result<usize, ()> {
27+
Ok(1)
28+
}
29+
}

0 commit comments

Comments
 (0)