diff options
author | Ville Penttinen <[email protected]> | 2019-04-04 17:43:32 +0100 |
---|---|---|
committer | Ville Penttinen <[email protected]> | 2019-04-09 12:45:05 +0100 |
commit | ed65e2619a42aea7c375d0cbf81d337fffb11a46 (patch) | |
tree | 4d5bdbfc7bfdaee888f5e6598fa40e9fb172861c /crates | |
parent | 7ba22f1c19c8fbfe45630c35ebd963d4c5475bc9 (diff) |
Add no parameter test to call_info
Diffstat (limited to 'crates')
-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{}} } |