Add regression test for source line numbers
This commit is contained in:
parent
673fd23dff
commit
9e0c8b67e9
1 changed files with 35 additions and 0 deletions
35
tests/rustdoc/source-line-numbers.rs
Normal file
35
tests/rustdoc/source-line-numbers.rs
Normal file
|
@ -0,0 +1,35 @@
|
|||
// This test ensures that we have the expected number of line generated.
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
||||
//@ has 'src/foo/source-line-numbers.rs.html'
|
||||
//@ count - '//a[@data-nosnippet]' 35
|
||||
//@ has - '//a[@id="35"]' '35'
|
||||
|
||||
#[
|
||||
macro_export
|
||||
]
|
||||
macro_rules! bar {
|
||||
($x:ident) => {{
|
||||
$x += 2;
|
||||
$x *= 2;
|
||||
}}
|
||||
}
|
||||
|
||||
/*
|
||||
multi line
|
||||
comment
|
||||
*/
|
||||
fn x(_: u8, _: u8) {}
|
||||
|
||||
fn foo() {
|
||||
let mut y = 0;
|
||||
bar!(y);
|
||||
println!("
|
||||
{y}
|
||||
");
|
||||
x(
|
||||
1,
|
||||
2,
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue