about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/doc-auto-cfg.rs10
-rw-r--r--src/test/rustdoc/doc-cfg-hide.rs2
2 files changed, 9 insertions, 3 deletions
diff --git a/src/test/rustdoc/doc-auto-cfg.rs b/src/test/rustdoc/doc-auto-cfg.rs
index fcdd8354569..57dd0529535 100644
--- a/src/test/rustdoc/doc-auto-cfg.rs
+++ b/src/test/rustdoc/doc-auto-cfg.rs
@@ -3,6 +3,12 @@
 #![crate_name = "foo"]
 
 // @has foo/fn.foo.html
-// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-test'
-#[cfg(not(test))]
+// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-doctest'
+#[cfg(not(doctest))]
 pub fn foo() {}
+
+// @has foo/fn.bar.html
+// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc'
+// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'test'
+#[cfg(any(test, doc))]
+pub fn bar() {}
diff --git a/src/test/rustdoc/doc-cfg-hide.rs b/src/test/rustdoc/doc-cfg-hide.rs
index 424fa6d6a91..636957fe998 100644
--- a/src/test/rustdoc/doc-cfg-hide.rs
+++ b/src/test/rustdoc/doc-cfg-hide.rs
@@ -26,7 +26,7 @@ pub struct Hyperdulia;
 
 // @has 'oud/struct.Oystercatcher.html'
 // @count   - '//*[@class="stab portability"]' 1
-// @matches - '//*[@class="stab portability"]' 'crate features solecism and oystercatcher'
+// @matches - '//*[@class="stab portability"]' 'crate feature oystercatcher only'
 // compile-flags:--cfg feature="oystercatcher"
 #[cfg(all(feature = "solecism", feature = "oystercatcher"))]
 pub struct Oystercatcher;