aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
authorVille Penttinen <[email protected]>2019-04-04 17:43:32 +0100
committerVille Penttinen <[email protected]>2019-04-09 12:45:05 +0100
commited65e2619a42aea7c375d0cbf81d337fffb11a46 (patch)
tree4d5bdbfc7bfdaee888f5e6598fa40e9fb172861c /crates/ra_ide_api
parent7ba22f1c19c8fbfe45630c35ebd963d4c5475bc9 (diff)
Add no parameter test to call_info
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/call_info.rs19
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 {}
204fn bar() { foo(<|>); }"#,
205 );
206
207 assert!(info.parameters().is_empty());
208 assert_eq!(
209 info.label(),
210 r#"
211fn foo<T>() -> T
212where 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{}} }