Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/references.rs')
-rw-r--r--crates/ide/src/references.rs48
1 files changed, 47 insertions, 1 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs
index df7a4a3332..bdda25a111 100644
--- a/crates/ide/src/references.rs
+++ b/crates/ide/src/references.rs
@@ -308,6 +308,51 @@ 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
+ "#]],
+ );
+
+ check(
+ r#"
+fn test_func() {}
+
+fn func() {
+ test_func$0();
+}
+
+#[::core::prelude::v1::test]
+fn test() {
+ test_func();
+}
+"#,
+ expect![[r#"
+ test_func Function FileId(0) 0..17 3..12
+
+ FileId(0) 35..44
+ FileId(0) 96..105 Test
+ "#]],
+ );
+ }
+
+ #[test]
fn test_struct_literal_after_space() {
check(
r#"
@@ -454,6 +499,7 @@ fn main() {
"#]],
);
}
+
#[test]
fn test_variant_tuple_before_paren() {
check(
@@ -1435,7 +1481,7 @@ fn test$0() {
expect![[r#"
test Function FileId(0) 0..33 11..15
- FileId(0) 24..28
+ FileId(0) 24..28 Test
"#]],
);
}