Skip to content

Commit 51a993f

Browse files
Add test for associated constants in the sidebar
1 parent d6dbff5 commit 51a993f

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/test/rustdoc/associated-consts.rs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#![crate_name = "foo"]
2+
3+
pub trait Trait {
4+
const FOO: u32 = 12;
5+
6+
fn foo();
7+
}
8+
9+
pub struct Bar;
10+
11+
// @has 'foo/struct.Bar.html'
12+
// @has - '//h3[@class="sidebar-title"]' 'Associated Constants'
13+
// @has - '//div[@class="sidebar-elems"]//div[@class="sidebar-links"]/a' 'FOO'
14+
impl Trait for Bar {
15+
const FOO: u32 = 1;
16+
17+
fn foo() {}
18+
}
19+
20+
pub enum Foo {
21+
A,
22+
}
23+
24+
// @has 'foo/enum.Foo.html'
25+
// @has - '//h3[@class="sidebar-title"]' 'Associated Constants'
26+
// @has - '//div[@class="sidebar-elems"]//div[@class="sidebar-links"]/a' 'FOO'
27+
impl Trait for Foo {
28+
const FOO: u32 = 1;
29+
30+
fn foo() {}
31+
}

0 commit comments

Comments
 (0)