Skip to content

Commit f5b5d86

Browse files
Update rustdoc tests
1 parent 042e0d0 commit f5b5d86

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<span class="example"><span class="kw">let </span>x = <span class="number">1</span>;</span>
2-
<span class="kw">let </span>y = <span class="number">2</span>;
1+
<span class="example"><span class="kw">let </span>x = <span class="number">1</span>;
2+
</span><span class="kw">let </span>y = <span class="number">2</span>;

src/librustdoc/html/highlight/fixtures/sample.html

+8-7
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
.lifetime { color: #B76514; }
99
.question-mark { color: #ff9011; }
1010
</style>
11-
<pre><code><span class="attribute">#![crate_type = <span class="string">&quot;lib&quot;</span>]</span>
11+
<pre><code><span class="attribute">#![crate_type = <span class="string">&quot;lib&quot;</span>]
1212

13-
<span class="kw">use </span>std::path::{Path, PathBuf};
13+
</span><span class="kw">use </span>std::path::{Path, PathBuf};
1414

15-
<span class="attribute">#[cfg(target_os = <span class="string">&quot;linux&quot;</span>)]</span>
16-
<span class="kw">fn </span>main() -&gt; () {
15+
<span class="attribute">#[cfg(target_os = <span class="string">&quot;linux&quot;</span>)]
16+
#[cfg(target_os = <span class="string">&quot;windows&quot;</span>)]
17+
</span><span class="kw">fn </span>main() -&gt; () {
1718
<span class="kw">let </span>foo = <span class="bool-val">true </span>&amp;&amp; <span class="bool-val">false </span>|| <span class="bool-val">true</span>;
1819
<span class="kw">let _</span>: <span class="kw-2">*const </span>() = <span class="number">0</span>;
1920
<span class="kw">let _ </span>= <span class="kw-2">&amp;</span>foo;
@@ -22,16 +23,16 @@
2223
<span class="macro">mac!</span>(foo, <span class="kw-2">&amp;mut </span>bar);
2324
<span class="macro">assert!</span>(<span class="self">self</span>.length &lt; N &amp;&amp; index &lt;= <span class="self">self</span>.length);
2425
::std::env::var(<span class="string">&quot;gateau&quot;</span>).is_ok();
25-
<span class="attribute">#[rustfmt::skip]</span>
26-
<span class="kw">let </span>s:std::path::PathBuf = std::path::PathBuf::new();
26+
<span class="attribute">#[rustfmt::skip]
27+
</span><span class="kw">let </span>s:std::path::PathBuf = std::path::PathBuf::new();
2728
<span class="kw">let </span><span class="kw-2">mut </span>s = String::new();
2829

2930
<span class="kw">match </span><span class="kw-2">&amp;</span>s {
3031
<span class="kw-2">ref mut </span>x =&gt; {}
3132
}
3233
}
3334

34-
<span class="macro">macro_rules!</span> bar {
35+
<span class="macro">macro_rules! </span>bar {
3536
(<span class="macro-nonterminal">$foo</span>:tt) =&gt; {};
3637
}
3738
</code></pre>

src/librustdoc/html/highlight/fixtures/sample.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use std::path::{Path, PathBuf};
44

55
#[cfg(target_os = "linux")]
6+
#[cfg(target_os = "windows")]
67
fn main() -> () {
78
let foo = true && false || true;
89
let _: *const () = 0;
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<code># single
22
## double
33
### triple
4-
<span class="attribute">#[outer]</span>
5-
<span class="attribute">#![inner]</span></code>
4+
<span class="attribute">#[outer]
5+
#![inner]</span></code>

src/test/rustdoc/issue-41783.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// @has issue_41783/struct.Foo.html
22
// @!hasraw - 'space'
33
// @!hasraw - 'comment'
4-
// @hasraw - '<span class="attribute">#[outer]</span>'
5-
// @hasraw - '<span class="attribute">#![inner]</span>'
4+
// @hasraw - '<span class="attribute">#[outer]'
5+
// @!hasraw - '<span class="attribute">#[outer]</span>'
6+
// @hasraw - '#![inner]</span>'
7+
// @!hasraw - '<span class="attribute">#![inner]</span>'
68
// @snapshot 'codeblock' - '//*[@class="rustdoc-toggle top-doc"]/*[@class="docblock"]//pre/code'
79

810
/// ```no_run

0 commit comments

Comments
 (0)