about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaximilian KΓΆhl <mail@koehlma.de>2022-03-21 11:40:25 +0100
committerMaximilian KΓΆhl <mail@koehlma.de>2022-03-21 11:40:25 +0100
commit1c523ba772490088ed4b5cd9345a8f46d2f7bf42 (patch)
tree19e8a48ebbbef50fce032c0fce0c1553e16ec74c
parent4df867c4a3d6d5e05b0193bf43e888673d5b64a9 (diff)
downloadrust-1c523ba772490088ed4b5cd9345a8f46d2f7bf42.tar.gz
rust-1c523ba772490088ed4b5cd9345a8f46d2f7bf42.zip
add tests for πŸ”’
-rw-r--r--src/test/rustdoc/visibility.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/rustdoc/visibility.rs b/src/test/rustdoc/visibility.rs
index cd284dad390..c573e1b77f9 100644
--- a/src/test/rustdoc/visibility.rs
+++ b/src/test/rustdoc/visibility.rs
@@ -4,42 +4,68 @@
 
 #![crate_name = "foo"]
 
+// @!has 'foo/index.html' '//a[@href="struct.FooPublic.html"]/..' 'FooPublic πŸ”’'
 // @has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic'
 pub struct FooPublic;
+// @has 'foo/index.html' '//a[@href="struct.FooJustCrate.html"]/..' 'FooJustCrate πŸ”’'
 // @has 'foo/struct.FooJustCrate.html' '//pre' 'pub(crate) struct FooJustCrate'
 crate struct FooJustCrate;
+// @has 'foo/index.html' '//a[@href="struct.FooPubCrate.html"]/..' 'FooPubCrate πŸ”’'
 // @has 'foo/struct.FooPubCrate.html' '//pre' 'pub(crate) struct FooPubCrate'
 pub(crate) struct FooPubCrate;
+// @has 'foo/index.html' '//a[@href="struct.FooSelf.html"]/..' 'FooSelf πŸ”’'
 // @has 'foo/struct.FooSelf.html' '//pre' 'pub(crate) struct FooSelf'
 pub(self) struct FooSelf;
+// @has 'foo/index.html' '//a[@href="struct.FooInSelf.html"]/..' 'FooInSelf πŸ”’'
 // @has 'foo/struct.FooInSelf.html' '//pre' 'pub(crate) struct FooInSelf'
 pub(in self) struct FooInSelf;
+// @has 'foo/index.html' '//a[@href="struct.FooPriv.html"]/..' 'FooPriv πŸ”’'
 // @has 'foo/struct.FooPriv.html' '//pre' 'pub(crate) struct FooPriv'
 struct FooPriv;
 
+// @!has 'foo/index.html' '//a[@href="pub_mod/index.html"]/..' 'pub_mod πŸ”’'
+pub mod pub_mod {}
+
+// @has 'foo/index.html' '//a[@href="pub_crate_mod/index.html"]/..' 'pub_crate_mod πŸ”’'
+pub(crate) mod pub_crate_mod {}
+
+// @has 'foo/index.html' '//a[@href="a/index.html"]/..' 'a πŸ”’'
 mod a {
+    // @has 'foo/a/index.html' '//a[@href="struct.FooASuper.html"]/..' 'FooASuper πŸ”’'
     // @has 'foo/a/struct.FooASuper.html' '//pre' 'pub(crate) struct FooASuper'
     pub(super) struct FooASuper;
+    // @has 'foo/a/index.html' '//a[@href="struct.FooAInSuper.html"]/..' 'FooAInSuper πŸ”’'
     // @has 'foo/a/struct.FooAInSuper.html' '//pre' 'pub(crate) struct FooAInSuper'
     pub(in super) struct FooAInSuper;
+    // @has 'foo/a/index.html' '//a[@href="struct.FooAInA.html"]/..' 'FooAInA πŸ”’'
     // @has 'foo/a/struct.FooAInA.html' '//pre' 'struct FooAInA'
     // @!has 'foo/a/struct.FooAInA.html' '//pre' 'pub'
     pub(in a) struct FooAInA;
+    // @has 'foo/a/index.html' '//a[@href="struct.FooAPriv.html"]/..' 'FooAPriv πŸ”’'
     // @has 'foo/a/struct.FooAPriv.html' '//pre' 'struct FooAPriv'
     // @!has 'foo/a/struct.FooAPriv.html' '//pre' 'pub'
     struct FooAPriv;
 
+    // @has 'foo/a/index.html' '//a[@href="b/index.html"]/..' 'b πŸ”’'
     mod b {
+        // @has 'foo/a/b/index.html' '//a[@href="struct.FooBSuper.html"]/..' 'FooBSuper πŸ”’'
         // @has 'foo/a/b/struct.FooBSuper.html' '//pre' 'pub(super) struct FooBSuper'
         pub(super) struct FooBSuper;
+        // @has 'foo/a/b/index.html' '//a[@href="struct.FooBInSuperSuper.html"]/..' 'FooBInSuperSuper πŸ”’'
         // @has 'foo/a/b/struct.FooBInSuperSuper.html' '//pre' 'pub(crate) struct FooBInSuperSuper'
         pub(in super::super) struct FooBInSuperSuper;
+        // @has 'foo/a/b/index.html' '//a[@href="struct.FooBInAB.html"]/..' 'FooBInAB πŸ”’'
         // @has 'foo/a/b/struct.FooBInAB.html' '//pre' 'struct FooBInAB'
         // @!has 'foo/a/b/struct.FooBInAB.html' '//pre' 'pub'
         pub(in a::b) struct FooBInAB;
+        // @has 'foo/a/b/index.html' '//a[@href="struct.FooBPriv.html"]/..' 'FooBPriv πŸ”’'
         // @has 'foo/a/b/struct.FooBPriv.html' '//pre' 'struct FooBPriv'
         // @!has 'foo/a/b/struct.FooBPriv.html' '//pre' 'pub'
         struct FooBPriv;
+
+        // @!has 'foo/a/b/index.html' '//a[@href="struct.FooBPub.html"]/..' 'FooBPub πŸ”’'
+        // @has 'foo/a/b/struct.FooBPub.html' '//pre' 'pub struct FooBPub'
+        pub struct FooBPub;
     }
 }
 
@@ -53,6 +79,8 @@ mod a {
 //
 // @has 'foo/trait.PubTrait.html' '//pre' 'fn function();'
 // @!has 'foo/trait.PubTrait.html' '//pre' 'pub fn function();'
+//
+// @!has 'foo/index.html' '//a[@href="trait.PubTrait.html"]/..' 'PubTrait πŸ”’'
 
 pub trait PubTrait {
     type Type;
@@ -60,6 +88,9 @@ pub trait PubTrait {
     fn function();
 }
 
+// @has 'foo/index.html' '//a[@href="trait.PrivTrait.html"]/..' 'PrivTrait πŸ”’'
+trait PrivTrait {}
+
 // @has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'type Type'
 // @!has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'pub type Type'
 //