Add test for associated constants in the sidebar
This commit is contained in:
parent
d6dbff56e4
commit
51a993f4a6
1 changed files with 31 additions and 0 deletions
31
src/test/rustdoc/associated-consts.rs
Normal file
31
src/test/rustdoc/associated-consts.rs
Normal file
|
@ -0,0 +1,31 @@
|
|||
#![crate_name = "foo"]
|
||||
|
||||
pub trait Trait {
|
||||
const FOO: u32 = 12;
|
||||
|
||||
fn foo();
|
||||
}
|
||||
|
||||
pub struct Bar;
|
||||
|
||||
// @has 'foo/struct.Bar.html'
|
||||
// @has - '//h3[@class="sidebar-title"]' 'Associated Constants'
|
||||
// @has - '//div[@class="sidebar-elems"]//div[@class="sidebar-links"]/a' 'FOO'
|
||||
impl Trait for Bar {
|
||||
const FOO: u32 = 1;
|
||||
|
||||
fn foo() {}
|
||||
}
|
||||
|
||||
pub enum Foo {
|
||||
A,
|
||||
}
|
||||
|
||||
// @has 'foo/enum.Foo.html'
|
||||
// @has - '//h3[@class="sidebar-title"]' 'Associated Constants'
|
||||
// @has - '//div[@class="sidebar-elems"]//div[@class="sidebar-links"]/a' 'FOO'
|
||||
impl Trait for Foo {
|
||||
const FOO: u32 = 1;
|
||||
|
||||
fn foo() {}
|
||||
}
|
Loading…
Reference in a new issue