test: add tests for constants inside range pattern

This commit is contained in:
roife 2024-03-05 19:31:01 +08:00
parent 96a7c6ae3c
commit 16995ceda9

View file

@ -532,6 +532,24 @@ fn bar() {
$0foo!() => {}
}
}
"#,
);
}
#[test]
fn goto_definition_works_for_consts_inside_range_pattern() {
check(
r#"
//- /lib.rs
const A: u32 = 0;
//^
fn bar(v: u32) {
match v {
0..=$0A => {}
_ => {}
}
}
"#,
);
}