From 58a6ec549d638455f5b5447bbbc174993e51e288 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sat, 17 Apr 2021 21:34:14 +0200 Subject: Add some more error messages to fixture failure cases --- crates/ide_assists/src/tests.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/ide_assists/src') diff --git a/crates/ide_assists/src/tests.rs b/crates/ide_assists/src/tests.rs index a7a923beb..60e3a1474 100644 --- a/crates/ide_assists/src/tests.rs +++ b/crates/ide_assists/src/tests.rs @@ -84,7 +84,8 @@ fn check_doc_test(assist_id: &str, before: &str, after: &str) { }); let actual = { - let source_change = assist.source_change.unwrap(); + let source_change = + assist.source_change.expect("Assist did not contain any source changes"); let mut actual = before; if let Some(source_file_edit) = source_change.get_source_edit(file_id) { source_file_edit.apply(&mut actual); @@ -121,7 +122,8 @@ fn check(handler: Handler, before: &str, expected: ExpectedResult, assist_label: match (assist, expected) { (Some(assist), ExpectedResult::After(after)) => { - let source_change = assist.source_change.unwrap(); + let source_change = + assist.source_change.expect("Assist did not contain any source changes"); assert!(!source_change.source_file_edits.is_empty()); let skip_header = source_change.source_file_edits.len() == 1 && source_change.file_system_edits.len() == 0; -- cgit v1.2.3