diff options
Diffstat (limited to 'crates/ra_assists/src/doc_tests.rs')
-rw-r--r-- | crates/ra_assists/src/doc_tests.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ra_assists/src/doc_tests.rs b/crates/ra_assists/src/doc_tests.rs index 88e901517..872bbdf17 100644 --- a/crates/ra_assists/src/doc_tests.rs +++ b/crates/ra_assists/src/doc_tests.rs | |||
@@ -15,8 +15,10 @@ fn check(assist_id: &str, before: &str, after: &str) { | |||
15 | let (db, _source_root, file_id) = MockDatabase::with_single_file(&before); | 15 | let (db, _source_root, file_id) = MockDatabase::with_single_file(&before); |
16 | let frange = FileRange { file_id, range: TextRange::offset_len(before_cursor_pos, 0.into()) }; | 16 | let frange = FileRange { file_id, range: TextRange::offset_len(before_cursor_pos, 0.into()) }; |
17 | 17 | ||
18 | let (_assist_id, action) = | 18 | let (_assist_id, action) = crate::assists(&db, frange) |
19 | crate::assists(&db, frange).into_iter().find(|(id, _)| id.id.0 == assist_id).unwrap(); | 19 | .into_iter() |
20 | .find(|(id, _)| id.id.0 == assist_id) | ||
21 | .unwrap_or_else(|| panic!("Assist {:?} is not applicable", assist_id)); | ||
20 | 22 | ||
21 | let actual = action.edit.apply(&before); | 23 | let actual = action.edit.apply(&before); |
22 | assert_eq_text!(after, &actual); | 24 | assert_eq_text!(after, &actual); |