Rustdoc-Json: Add tests for linking to foreign variants.
This commit is contained in:
parent
69df0f2c2f
commit
d958f3773a
3 changed files with 25 additions and 0 deletions
5
src/test/rustdoc-json/enums/auxiliary/color.rs
Normal file
5
src/test/rustdoc-json/enums/auxiliary/color.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
pub enum Color {
|
||||
Red,
|
||||
Green,
|
||||
Blue,
|
||||
}
|
11
src/test/rustdoc-json/enums/doc_link_to_foreign_variant.rs
Normal file
11
src/test/rustdoc-json/enums/doc_link_to_foreign_variant.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
// aux-build: color.rs
|
||||
|
||||
//! The purpose of this test it to have a link to [a foreign variant](Red).
|
||||
|
||||
extern crate color;
|
||||
use color::Color::Red;
|
||||
|
||||
// @set red = "$.index[*][?(@.inner.is_crate == true)].links.Red"
|
||||
|
||||
// @!has "$.index[*][?(@.name == 'Red')]"
|
||||
// @!has "$.index[*][?(@.name == 'Color')]"
|
9
src/test/rustdoc-json/enums/use_variant_foreign.rs
Normal file
9
src/test/rustdoc-json/enums/use_variant_foreign.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
// aux-build: color.rs
|
||||
|
||||
extern crate color;
|
||||
|
||||
// @is "$.index[*][?(@.inner.name == 'Red')].kind" '"import"'
|
||||
pub use color::Color::Red;
|
||||
|
||||
// @!has "$.index[*][?(@.name == 'Red')]"
|
||||
// @!has "$.index[*][?(@.name == 'Color')]"
|
Loading…
Add table
Reference in a new issue