Add regression test for source line numbers

This commit is contained in:
Guillaume Gomez 2025-02-10 18:49:09 +01:00
parent 673fd23dff
commit 9e0c8b67e9

View 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,
);
}