Add test for associated items in rustdoc JSON
This commit is contained in:
parent
c1c0d25939
commit
9277f959dd
29
src/test/rustdoc-json/assoc_items.rs
Normal file
29
src/test/rustdoc-json/assoc_items.rs
Normal file
@ -0,0 +1,29 @@
|
||||
#![no_std]
|
||||
|
||||
// @has assoc_items.json
|
||||
|
||||
pub struct Simple;
|
||||
|
||||
impl Simple {
|
||||
// @has - "$.index[*][?(@.name=='CONSTANT')].kind" \"assoc_const\"
|
||||
pub const CONSTANT: usize = 0;
|
||||
}
|
||||
|
||||
pub trait EasyToImpl {
|
||||
// @has - "$.index[*][?(@.name=='ToDeclare')].kind" \"assoc_type\"
|
||||
// @has - "$.index[*][?(@.name=='ToDeclare')].inner.default" null
|
||||
type ToDeclare;
|
||||
// @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].kind" \"assoc_const\"
|
||||
// @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].inner.default" null
|
||||
const AN_ATTRIBUTE: usize;
|
||||
}
|
||||
|
||||
impl EasyToImpl for Simple {
|
||||
// @has - "$.index[*][?(@.name=='ToDeclare')].inner.default.kind" \"primitive\"
|
||||
// @has - "$.index[*][?(@.name=='ToDeclare')].inner.default.inner" \"usize\"
|
||||
type ToDeclare = usize;
|
||||
// @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].inner.type.kind" \"primitive\"
|
||||
// @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].inner.type.inner" \"usize\"
|
||||
// @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].inner.default" \"12\"
|
||||
const AN_ATTRIBUTE: usize = 12;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user