From ed65e2619a42aea7c375d0cbf81d337fffb11a46 Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Thu, 4 Apr 2019 19:43:32 +0300 Subject: Add no parameter test to call_info --- crates/ra_ide_api/src/call_info.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/call_info.rs b/crates/ra_ide_api/src/call_info.rs index 3c53bd11a..1885d3da8 100644 --- a/crates/ra_ide_api/src/call_info.rs +++ b/crates/ra_ide_api/src/call_info.rs @@ -197,6 +197,25 @@ where T: Copy + Display, assert_eq!(info.active_parameter, Some(0)); } + #[test] + fn test_fn_signature_no_params() { + let info = call_info( + r#"fn foo() -> T where T: Copy + Display {} +fn bar() { foo(<|>); }"#, + ); + + assert!(info.parameters().is_empty()); + assert_eq!( + info.label(), + r#" +fn foo() -> T +where T: Copy + Display + "# + .trim() + ); + assert!(info.active_parameter.is_none()); + } + #[test] fn test_fn_signature_for_impl() { let info = call_info( -- cgit v1.2.3