diff options
| author | Young-Flash <dongyang@apache.org> | 2024-01-28 18:39:42 +0800 |
|---|---|---|
| committer | Young-Flash <dongyang@apache.org> | 2024-01-28 18:39:42 +0800 |
| commit | 1bd21e98c0b67097b7c242e6ebc24085bfba982c (patch) | |
| tree | b6ab7fb59dea0de708b795a6f40bbc7cdf592517 | |
| parent | 6f303f49fed35a0101b5fce1977bf719045d97df (diff) | |
| download | rust-1bd21e98c0b67097b7c242e6ebc24085bfba982c.tar.gz rust-1bd21e98c0b67097b7c242e6ebc24085bfba982c.zip | |
test: add test for excluding refs
| -rw-r--r-- | crates/ide/src/references.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index bcf862012a6..4b695612a69 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs @@ -308,6 +308,30 @@ mod tests { use crate::{fixture, SearchScope}; #[test] + fn exclude_tests() { + check( + r#" +fn test_func() {} + +fn func() { + test_func$0(); +} + +#[test] +fn test() { + test_func(); +} +"#, + expect![[r#" + test_func Function FileId(0) 0..17 3..12 + + FileId(0) 35..44 + FileId(0) 75..84 Test + "#]], + ); + } + + #[test] fn test_struct_literal_after_space() { check( r#" |
