aboutsummaryrefslogtreecommitdiff
path: root/crates/assists
diff options
context:
space:
mode:
Diffstat (limited to 'crates/assists')
-rw-r--r--crates/assists/src/tests.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/assists/src/tests.rs b/crates/assists/src/tests.rs
index 1bdcb9ede..5b9992f15 100644
--- a/crates/assists/src/tests.rs
+++ b/crates/assists/src/tests.rs
@@ -49,14 +49,17 @@ pub(crate) fn check_assist_by_label(
49// FIXME: instead of having a separate function here, maybe use 49// FIXME: instead of having a separate function here, maybe use
50// `extract_ranges` and mark the target as `<target> </target>` in the 50// `extract_ranges` and mark the target as `<target> </target>` in the
51// fixture? 51// fixture?
52#[track_caller]
52pub(crate) fn check_assist_target(assist: Handler, ra_fixture: &str, target: &str) { 53pub(crate) fn check_assist_target(assist: Handler, ra_fixture: &str, target: &str) {
53 check(assist, ra_fixture, ExpectedResult::Target(target), None); 54 check(assist, ra_fixture, ExpectedResult::Target(target), None);
54} 55}
55 56
57#[track_caller]
56pub(crate) fn check_assist_not_applicable(assist: Handler, ra_fixture: &str) { 58pub(crate) fn check_assist_not_applicable(assist: Handler, ra_fixture: &str) {
57 check(assist, ra_fixture, ExpectedResult::NotApplicable, None); 59 check(assist, ra_fixture, ExpectedResult::NotApplicable, None);
58} 60}
59 61
62#[track_caller]
60fn check_doc_test(assist_id: &str, before: &str, after: &str) { 63fn check_doc_test(assist_id: &str, before: &str, after: &str) {
61 let after = trim_indent(after); 64 let after = trim_indent(after);
62 let (db, file_id, selection) = RootDatabase::with_range_or_offset(&before); 65 let (db, file_id, selection) = RootDatabase::with_range_or_offset(&before);
@@ -95,6 +98,7 @@ enum ExpectedResult<'a> {
95 Target(&'a str), 98 Target(&'a str),
96} 99}
97 100
101#[track_caller]
98fn check(handler: Handler, before: &str, expected: ExpectedResult, assist_label: Option<&str>) { 102fn check(handler: Handler, before: &str, expected: ExpectedResult, assist_label: Option<&str>) {
99 let (db, file_with_caret_id, range_or_offset) = RootDatabase::with_range_or_offset(before); 103 let (db, file_with_caret_id, range_or_offset) = RootDatabase::with_range_or_offset(before);
100 let text_without_caret = db.file_text(file_with_caret_id).to_string(); 104 let text_without_caret = db.file_text(file_with_caret_id).to_string();