Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
11
tests/rustdoc-json/structs/plain_all_pub.rs
Normal file
11
tests/rustdoc-json/structs/plain_all_pub.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
pub struct Demo {
|
||||
pub x: i32,
|
||||
pub y: i32,
|
||||
}
|
||||
|
||||
// @set x = "$.index[*][?(@.name=='x')].id"
|
||||
// @set y = "$.index[*][?(@.name=='y')].id"
|
||||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[0]" $x
|
||||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[1]" $y
|
||||
// @count "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[*]" 2
|
||||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields_stripped" false
|
11
tests/rustdoc-json/structs/plain_doc_hidden.rs
Normal file
11
tests/rustdoc-json/structs/plain_doc_hidden.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
pub struct Demo {
|
||||
pub x: i32,
|
||||
#[doc(hidden)]
|
||||
pub y: i32,
|
||||
}
|
||||
|
||||
// @set x = "$.index[*][?(@.name=='x')].id"
|
||||
// @!has "$.index[*][?(@.name=='y')].id"
|
||||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[0]" $x
|
||||
// @count "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[*]" 1
|
||||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields_stripped" true
|
5
tests/rustdoc-json/structs/plain_empty.rs
Normal file
5
tests/rustdoc-json/structs/plain_empty.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
// @is "$.index[*][?(@.name=='PlainEmpty')].visibility" \"public\"
|
||||
// @is "$.index[*][?(@.name=='PlainEmpty')].kind" \"struct\"
|
||||
// @is "$.index[*][?(@.name=='PlainEmpty')].inner.kind.plain.fields_stripped" false
|
||||
// @is "$.index[*][?(@.name=='PlainEmpty')].inner.kind.plain.fields" []
|
||||
pub struct PlainEmpty {}
|
9
tests/rustdoc-json/structs/plain_pub_priv.rs
Normal file
9
tests/rustdoc-json/structs/plain_pub_priv.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
pub struct Demo {
|
||||
pub x: i32,
|
||||
y: i32,
|
||||
}
|
||||
|
||||
// @set x = "$.index[*][?(@.name=='x')].id"
|
||||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[0]" $x
|
||||
// @count "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[*]" 1
|
||||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields_stripped" true
|
4
tests/rustdoc-json/structs/tuple.rs
Normal file
4
tests/rustdoc-json/structs/tuple.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
// @is "$.index[*][?(@.name=='Tuple')].visibility" \"public\"
|
||||
// @is "$.index[*][?(@.name=='Tuple')].kind" \"struct\"
|
||||
// @is "$.index[*][?(@.name=='Tuple')].inner.kind.tuple" '[null, null]'
|
||||
pub struct Tuple(u32, String);
|
2
tests/rustdoc-json/structs/tuple_empty.rs
Normal file
2
tests/rustdoc-json/structs/tuple_empty.rs
Normal file
|
@ -0,0 +1,2 @@
|
|||
// @is "$.index[*][?(@.name=='TupleUnit')].inner.kind.tuple" []
|
||||
pub struct TupleUnit();
|
13
tests/rustdoc-json/structs/tuple_pub_priv.rs
Normal file
13
tests/rustdoc-json/structs/tuple_pub_priv.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
pub struct Demo(
|
||||
i32,
|
||||
/// field
|
||||
pub i32,
|
||||
#[doc(hidden)] i32,
|
||||
);
|
||||
|
||||
// @set field = "$.index[*][?(@.docs=='field')].id"
|
||||
|
||||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.tuple[0]" null
|
||||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.tuple[1]" $field
|
||||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.tuple[2]" null
|
||||
// @count "$.index[*][?(@.name=='Demo')].inner.kind.tuple[*]" 3
|
4
tests/rustdoc-json/structs/unit.rs
Normal file
4
tests/rustdoc-json/structs/unit.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
// @is "$.index[*][?(@.name=='Unit')].visibility" \"public\"
|
||||
// @is "$.index[*][?(@.name=='Unit')].kind" \"struct\"
|
||||
// @is "$.index[*][?(@.name=='Unit')].inner.kind" \"unit\"
|
||||
pub struct Unit;
|
14
tests/rustdoc-json/structs/with_generics.rs
Normal file
14
tests/rustdoc-json/structs/with_generics.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
// @is "$.index[*][?(@.name=='WithGenerics')].visibility" \"public\"
|
||||
// @is "$.index[*][?(@.name=='WithGenerics')].kind" \"struct\"
|
||||
// @is "$.index[*][?(@.name=='WithGenerics')].inner.generics.params[0].name" \"T\"
|
||||
// @is "$.index[*][?(@.name=='WithGenerics')].inner.generics.params[0].kind.type.bounds" []
|
||||
// @is "$.index[*][?(@.name=='WithGenerics')].inner.generics.params[1].name" \"U\"
|
||||
// @is "$.index[*][?(@.name=='WithGenerics')].inner.generics.params[1].kind.type.bounds" []
|
||||
// @is "$.index[*][?(@.name=='WithGenerics')].inner.kind.plain.fields_stripped" true
|
||||
// @is "$.index[*][?(@.name=='WithGenerics')].inner.kind.plain.fields" []
|
||||
pub struct WithGenerics<T, U> {
|
||||
stuff: Vec<T>,
|
||||
things: HashMap<U, U>,
|
||||
}
|
10
tests/rustdoc-json/structs/with_primitives.rs
Normal file
10
tests/rustdoc-json/structs/with_primitives.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// @is "$.index[*][?(@.name=='WithPrimitives')].visibility" \"public\"
|
||||
// @is "$.index[*][?(@.name=='WithPrimitives')].kind" \"struct\"
|
||||
// @is "$.index[*][?(@.name=='WithPrimitives')].inner.generics.params[0].name" \"\'a\"
|
||||
// @is "$.index[*][?(@.name=='WithPrimitives')].inner.generics.params[0].kind.lifetime.outlives" []
|
||||
// @is "$.index[*][?(@.name=='WithPrimitives')].inner.kind.plain.fields_stripped" true
|
||||
// @is "$.index[*][?(@.name=='WithPrimitives')].inner.kind.plain.fields" []
|
||||
pub struct WithPrimitives<'a> {
|
||||
num: u32,
|
||||
s: &'a str,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue