File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff 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#"
565575struct TS { x: u32, y: i32 }
566576fn 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#"
601610enum E {
602611 /// A Variant
You can’t perform that action at this time.
0 commit comments