Skip to content

Commit 0f5d676

Browse files
committed
Remove #[should_panic] from call_info tests
1 parent fd06fe7 commit 0f5d676

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

crates/ra_ide/src/call_info.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,20 @@ mod tests {
208208
}
209209
}
210210

211-
fn call_info(text: &str) -> CallInfo {
211+
fn call_info_helper(text: &str) -> Option<CallInfo> {
212212
let (analysis, position) = single_file_with_position(text);
213-
analysis.call_info(position).unwrap().unwrap()
213+
analysis.call_info(position).unwrap()
214+
}
215+
216+
fn call_info(text: &str) -> CallInfo {
217+
let info = call_info_helper(text);
218+
assert!(info.is_some());
219+
info.unwrap()
220+
}
221+
222+
fn no_call_info(text: &str) {
223+
let info = call_info_helper(text);
224+
assert!(info.is_none());
214225
}
215226

216227
#[test]
@@ -558,9 +569,8 @@ fn main() {
558569
}
559570

560571
#[test]
561-
#[should_panic]
562572
fn cant_call_named_structs() {
563-
let _ = call_info(
573+
no_call_info(
564574
r#"
565575
struct TS { x: u32, y: i32 }
566576
fn main() {
@@ -594,9 +604,8 @@ fn main() {
594604
}
595605

596606
#[test]
597-
#[should_panic]
598607
fn cant_call_enum_records() {
599-
let _ = call_info(
608+
no_call_info(
600609
r#"
601610
enum E {
602611
/// A Variant

0 commit comments

Comments
 (0)