Skip to content

Commit d958f37

Browse files
committed
Rustdoc-Json: Add tests for linking to foreign variants.
1 parent 69df0f2 commit d958f37

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pub enum Color {
2+
Red,
3+
Green,
4+
Blue,
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// aux-build: color.rs
2+
3+
//! The purpose of this test it to have a link to [a foreign variant](Red).
4+
5+
extern crate color;
6+
use color::Color::Red;
7+
8+
// @set red = "$.index[*][?(@.inner.is_crate == true)].links.Red"
9+
10+
// @!has "$.index[*][?(@.name == 'Red')]"
11+
// @!has "$.index[*][?(@.name == 'Color')]"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// aux-build: color.rs
2+
3+
extern crate color;
4+
5+
// @is "$.index[*][?(@.inner.name == 'Red')].kind" '"import"'
6+
pub use color::Color::Red;
7+
8+
// @!has "$.index[*][?(@.name == 'Red')]"
9+
// @!has "$.index[*][?(@.name == 'Color')]"

0 commit comments

Comments
 (0)