Add no parameter test to call_info

This commit is contained in:
Ville Penttinen 2019-04-04 19:43:32 +03:00
parent 7ba22f1c19
commit ed65e2619a

View File

@ -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>() -> T where T: Copy + Display {}
fn bar() { foo(<|>); }"#,
);
assert!(info.parameters().is_empty());
assert_eq!(
info.label(),
r#"
fn foo<T>() -> T
where T: Copy + Display
"#
.trim()
);
assert!(info.active_parameter.is_none());
}
#[test]
fn test_fn_signature_for_impl() {
let info = call_info(