aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Kolb <[email protected]>2020-04-11 20:47:09 +0100
committerJeremy Kolb <[email protected]>2020-04-11 20:47:09 +0100
commit0f5d6766fd5b18716ede611060a69cbff9c2a35c (patch)
treee025afecb8ea88319b9a04d227aa59dbb2b60d1d
parentfd06fe7b13045185ab4e630b0044aa9d8bbcdf8a (diff)
Remove #[should_panic] from call_info tests
-rw-r--r--crates/ra_ide/src/call_info.rs21
1 files changed, 15 insertions, 6 deletions
diff --git a/crates/ra_ide/src/call_info.rs b/crates/ra_ide/src/call_info.rs
index ca57eceff..f95b6baf3 100644
--- a/crates/ra_ide/src/call_info.rs
+++ b/crates/ra_ide/src/call_info.rs
@@ -208,9 +208,20 @@ mod tests {
208 } 208 }
209 } 209 }
210 210
211 fn call_info(text: &str) -> CallInfo { 211 fn call_info_helper(text: &str) -> Option<CallInfo> {
212 let (analysis, position) = single_file_with_position(text); 212 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());
214 } 225 }
215 226
216 #[test] 227 #[test]
@@ -558,9 +569,8 @@ fn main() {
558 } 569 }
559 570
560 #[test] 571 #[test]
561 #[should_panic]
562 fn cant_call_named_structs() { 572 fn cant_call_named_structs() {
563 let _ = call_info( 573 no_call_info(
564 r#" 574 r#"
565struct TS { x: u32, y: i32 } 575struct TS { x: u32, y: i32 }
566fn main() { 576fn main() {
@@ -594,9 +604,8 @@ fn main() {
594 } 604 }
595 605
596 #[test] 606 #[test]
597 #[should_panic]
598 fn cant_call_enum_records() { 607 fn cant_call_enum_records() {
599 let _ = call_info( 608 no_call_info(
600 r#" 609 r#"
601enum E { 610enum E {
602 /// A Variant 611 /// A Variant