Skip to content

Commit 9e0c8b6

Browse files
Add regression test for source line numbers
1 parent 673fd23 commit 9e0c8b6

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/rustdoc/source-line-numbers.rs

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// This test ensures that we have the expected number of line generated.
2+
3+
#![crate_name = "foo"]
4+
5+
//@ has 'src/foo/source-line-numbers.rs.html'
6+
//@ count - '//a[@data-nosnippet]' 35
7+
//@ has - '//a[@id="35"]' '35'
8+
9+
#[
10+
macro_export
11+
]
12+
macro_rules! bar {
13+
($x:ident) => {{
14+
$x += 2;
15+
$x *= 2;
16+
}}
17+
}
18+
19+
/*
20+
multi line
21+
comment
22+
*/
23+
fn x(_: u8, _: u8) {}
24+
25+
fn foo() {
26+
let mut y = 0;
27+
bar!(y);
28+
println!("
29+
{y}
30+
");
31+
x(
32+
1,
33+
2,
34+
);
35+
}

0 commit comments

Comments
 (0)