Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 16995ce

Browse files
committed
test: add tests for constants inside range pattern
1 parent 96a7c6a commit 16995ce

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

crates/ide/src/goto_definition.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,24 @@ fn bar() {
532532
$0foo!() => {}
533533
}
534534
}
535+
"#,
536+
);
537+
}
538+
539+
#[test]
540+
fn goto_definition_works_for_consts_inside_range_pattern() {
541+
check(
542+
r#"
543+
//- /lib.rs
544+
const A: u32 = 0;
545+
//^
546+
547+
fn bar(v: u32) {
548+
match v {
549+
0..=$0A => {}
550+
_ => {}
551+
}
552+
}
535553
"#,
536554
);
537555
}

0 commit comments

Comments
 (0)