mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Add no parameter test to call_info
This commit is contained in:
parent
7ba22f1c19
commit
ed65e2619a
1 changed files with 19 additions and 0 deletions
|
@ -197,6 +197,25 @@ where T: Copy + Display,
|
||||||
assert_eq!(info.active_parameter, Some(0));
|
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]
|
#[test]
|
||||||
fn test_fn_signature_for_impl() {
|
fn test_fn_signature_for_impl() {
|
||||||
let info = call_info(
|
let info = call_info(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue