about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYotam Ofek <yotam.ofek@gmail.com>2025-02-15 21:12:58 +0000
committerYotam Ofek <yotam.ofek@gmail.com>2025-02-16 19:34:50 +0000
commit2c1f48970cc7954de147d5f71cd718b9035c6788 (patch)
tree846a8506e428e60f9aa4c04580dd4c7b5b4f85ee
parenta3d4bd382ae42e348d7ca3756d291a7f7e47b9ce (diff)
downloadrust-2c1f48970cc7954de147d5f71cd718b9035c6788.tar.gz
rust-2c1f48970cc7954de147d5f71cd718b9035c6788.zip
fix rustdoc test directives that were accidentally ignored
replace "// @" with "//@ ", and fix the tests so they actually pass, after directives are checked
-rw-r--r--tests/rustdoc/anchor-id-duplicate-method-name-25001.rs4
-rw-r--r--tests/rustdoc/extremely_long_typename.extremely_long_typename.html2
-rw-r--r--tests/rustdoc/extremely_long_typename.rs2
-rw-r--r--tests/rustdoc/unsafe-extern-blocks.rs26
4 files changed, 17 insertions, 17 deletions
diff --git a/tests/rustdoc/anchor-id-duplicate-method-name-25001.rs b/tests/rustdoc/anchor-id-duplicate-method-name-25001.rs
index e1f19e7e017..d7f4e587d5e 100644
--- a/tests/rustdoc/anchor-id-duplicate-method-name-25001.rs
+++ b/tests/rustdoc/anchor-id-duplicate-method-name-25001.rs
@@ -24,14 +24,14 @@ impl Foo<u32> {
 }
 
 impl<T> Bar for Foo<T> {
-    // @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' 'type Item = T'
+    //@ has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' 'type Item = T'
     type Item=T;
 
     //@ has - '//*[@id="method.quux"]//h4[@class="code-header"]' 'fn quux(self)'
     fn quux(self) {}
 }
 impl<'a, T> Bar for &'a Foo<T> {
-    // @has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' "type Item = &'a T"
+    //@ has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' "type Item = &'a T"
     type Item=&'a T;
 
     //@ has - '//*[@id="method.quux-1"]//h4[@class="code-header"]' 'fn quux(self)'
diff --git a/tests/rustdoc/extremely_long_typename.extremely_long_typename.html b/tests/rustdoc/extremely_long_typename.extremely_long_typename.html
index b20e59866da..64c4d5fb3e3 100644
--- a/tests/rustdoc/extremely_long_typename.extremely_long_typename.html
+++ b/tests/rustdoc/extremely_long_typename.extremely_long_typename.html
@@ -1 +1 @@
-<li><div class="item-name"><a class="struct" href="struct.CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer.html" title="struct extremely_long_typename::CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer">Create<wbr />Subscription<wbr />Payment<wbr />Settings<wbr />Payment<wbr />Method<wbr />Options<wbr />Customer<wbr />Balance<wbr />Bank<wbr />Transfer<wbr />EuBank<wbr />Transfer</a></div></li>
\ No newline at end of file
+<dt><a class="struct" href="struct.CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer.html" title="struct extremely_long_typename::CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer">Create<wbr />Subscription<wbr />Payment<wbr />Settings<wbr />Payment<wbr />Method<wbr />Options<wbr />Customer<wbr />Balance<wbr />Bank<wbr />Transfer<wbr />EuBank<wbr />Transfer</a></dt>
\ No newline at end of file
diff --git a/tests/rustdoc/extremely_long_typename.rs b/tests/rustdoc/extremely_long_typename.rs
index 212afe2d110..a87c61e38bd 100644
--- a/tests/rustdoc/extremely_long_typename.rs
+++ b/tests/rustdoc/extremely_long_typename.rs
@@ -3,5 +3,5 @@
 // the item table has it line wrapped.
 // There should be some reasonably-placed `<wbr>` tags in the snapshot file.
 
-// @snapshot extremely_long_typename "extremely_long_typename/index.html" '//ul[@class="item-table"]/li'
+//@ snapshot extremely_long_typename "extremely_long_typename/index.html" '//dl[@class="item-table"]/dt'
 pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer;
diff --git a/tests/rustdoc/unsafe-extern-blocks.rs b/tests/rustdoc/unsafe-extern-blocks.rs
index 829095f300f..9a4e292dc83 100644
--- a/tests/rustdoc/unsafe-extern-blocks.rs
+++ b/tests/rustdoc/unsafe-extern-blocks.rs
@@ -2,28 +2,28 @@
 
 #![crate_name = "foo"]
 
-// @has 'foo/index.html'
+//@ has 'foo/index.html'
 
 // First we check that both the static and the function have a "sup" element
 // to tell they're unsafe.
 
-// @count - '//ul[@class="item-table"]//sup[@title="unsafe static"]' 1
-// @has - '//ul[@class="item-table"]//sup[@title="unsafe static"]' '⚠'
-// @count - '//ul[@class="item-table"]//sup[@title="unsafe function"]' 1
-// @has - '//ul[@class="item-table"]//sup[@title="unsafe function"]' '⚠'
+//@ count - '//dl[@class="item-table"]//sup[@title="unsafe static"]' 1
+//@ has - '//dl[@class="item-table"]//sup[@title="unsafe static"]' '⚠'
+//@ count - '//dl[@class="item-table"]//sup[@title="unsafe function"]' 1
+//@ has - '//dl[@class="item-table"]//sup[@title="unsafe function"]' '⚠'
 
 unsafe extern "C" {
-    // @has 'foo/static.FOO.html'
-    // @has - '//pre[@class="rust item-decl"]' 'pub static FOO: i32'
+    //@ has 'foo/static.FOO.html'
+    //@ has - '//pre[@class="rust item-decl"]' 'pub static FOO: i32'
     pub safe static FOO: i32;
-    // @has 'foo/static.BAR.html'
-    // @has - '//pre[@class="rust item-decl"]' 'pub unsafe static BAR: i32'
+    //@ has 'foo/static.BAR.html'
+    //@ has - '//pre[@class="rust item-decl"]' 'pub unsafe static BAR: i32'
     pub static BAR: i32;
 
-    // @has 'foo/fn.foo.html'
-    // @has - '//pre[@class="rust item-decl"]' 'pub extern "C" fn foo()'
+    //@ has 'foo/fn.foo.html'
+    //@ has - '//pre[@class="rust item-decl"]' 'pub extern "C" fn foo()'
     pub safe fn foo();
-    // @has 'foo/fn.bar.html'
-    // @has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn bar()'
+    //@ has 'foo/fn.bar.html'
+    //@ has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn bar()'
     pub fn bar();
 }