diff options
| author | Nixon Enraght-Moony <nixon.emoony@gmail.com> | 2022-11-28 19:29:23 +0000 |
|---|---|---|
| committer | Nixon Enraght-Moony <nixon.emoony@gmail.com> | 2022-11-28 19:34:13 +0000 |
| commit | d958f3773ad04410b9fa316c2c7e242963e51ac5 (patch) | |
| tree | 5a29b70a7677ea21105f92585dd21e2c964f8575 /src/test | |
| parent | 69df0f2c2f665d7f4e38a3579a81d4efc0d81034 (diff) | |
| download | rust-d958f3773ad04410b9fa316c2c7e242963e51ac5.tar.gz rust-d958f3773ad04410b9fa316c2c7e242963e51ac5.zip | |
Rustdoc-Json: Add tests for linking to foreign variants.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc-json/enums/auxiliary/color.rs | 5 | ||||
| -rw-r--r-- | src/test/rustdoc-json/enums/doc_link_to_foreign_variant.rs | 11 | ||||
| -rw-r--r-- | src/test/rustdoc-json/enums/use_variant_foreign.rs | 9 |
3 files changed, 25 insertions, 0 deletions
diff --git a/src/test/rustdoc-json/enums/auxiliary/color.rs b/src/test/rustdoc-json/enums/auxiliary/color.rs new file mode 100644 index 00000000000..7188f793832 --- /dev/null +++ b/src/test/rustdoc-json/enums/auxiliary/color.rs @@ -0,0 +1,5 @@ +pub enum Color { + Red, + Green, + Blue, +} diff --git a/src/test/rustdoc-json/enums/doc_link_to_foreign_variant.rs b/src/test/rustdoc-json/enums/doc_link_to_foreign_variant.rs new file mode 100644 index 00000000000..470b195a292 --- /dev/null +++ b/src/test/rustdoc-json/enums/doc_link_to_foreign_variant.rs @@ -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')]" diff --git a/src/test/rustdoc-json/enums/use_variant_foreign.rs b/src/test/rustdoc-json/enums/use_variant_foreign.rs new file mode 100644 index 00000000000..11bb6ce1f3a --- /dev/null +++ b/src/test/rustdoc-json/enums/use_variant_foreign.rs @@ -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')]" |
