diff options
Diffstat (limited to 'crates/ra_assists/src/doc_tests.rs')
-rw-r--r-- | crates/ra_assists/src/doc_tests.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/crates/ra_assists/src/doc_tests.rs b/crates/ra_assists/src/doc_tests.rs index 0ccf9d730..6e1e3de84 100644 --- a/crates/ra_assists/src/doc_tests.rs +++ b/crates/ra_assists/src/doc_tests.rs | |||
@@ -17,7 +17,17 @@ fn check(assist_id: &str, before: &str, after: &str) { | |||
17 | let (_assist_id, action) = crate::assists(&db, frange) | 17 | let (_assist_id, action) = crate::assists(&db, frange) |
18 | .into_iter() | 18 | .into_iter() |
19 | .find(|(id, _)| id.id.0 == assist_id) | 19 | .find(|(id, _)| id.id.0 == assist_id) |
20 | .unwrap_or_else(|| panic!("Assist {:?} is not applicable", assist_id)); | 20 | .unwrap_or_else(|| { |
21 | panic!( | ||
22 | "\n\nAssist is not applicable: {}\nAvailable assists: {}", | ||
23 | assist_id, | ||
24 | crate::assists(&db, frange) | ||
25 | .into_iter() | ||
26 | .map(|(id, _)| id.id.0) | ||
27 | .collect::<Vec<_>>() | ||
28 | .join(", ") | ||
29 | ) | ||
30 | }); | ||
21 | 31 | ||
22 | let actual = action.edit.apply(&before); | 32 | let actual = action.edit.apply(&before); |
23 | assert_eq_text!(after, &actual); | 33 | assert_eq_text!(after, &actual); |