Rustdoc-Json: Add tests for linking to foreign variants.

This commit is contained in:
Nixon Enraght-Moony 2022-11-28 19:29:23 +00:00
parent 69df0f2c2f
commit d958f3773a
3 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,5 @@
pub enum Color {
Red,
Green,
Blue,
}

View 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')]"

View 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')]"