Add test for associated constants in the sidebar

This commit is contained in:
Guillaume Gomez 2021-10-12 15:07:11 +02:00
parent d6dbff56e4
commit 51a993f4a6

View 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() {}
}