diff options
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r-- | crates/ra_ide_api/src/call_info.rs | 19 |
1 files changed, 19 insertions, 0 deletions
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 | |||
@@ -198,6 +198,25 @@ where T: Copy + Display, | |||
198 | } | 198 | } |
199 | 199 | ||
200 | #[test] | 200 | #[test] |
201 | fn test_fn_signature_no_params() { | ||
202 | let info = call_info( | ||
203 | r#"fn foo<T>() -> T where T: Copy + Display {} | ||
204 | fn bar() { foo(<|>); }"#, | ||
205 | ); | ||
206 | |||
207 | assert!(info.parameters().is_empty()); | ||
208 | assert_eq!( | ||
209 | info.label(), | ||
210 | r#" | ||
211 | fn foo<T>() -> T | ||
212 | where T: Copy + Display | ||
213 | "# | ||
214 | .trim() | ||
215 | ); | ||
216 | assert!(info.active_parameter.is_none()); | ||
217 | } | ||
218 | |||
219 | #[test] | ||
201 | fn test_fn_signature_for_impl() { | 220 | fn test_fn_signature_for_impl() { |
202 | let info = call_info( | 221 | let info = call_info( |
203 | r#"struct F; impl F { pub fn new() { F{}} } | 222 | r#"struct F; impl F { pub fn new() { F{}} } |