mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
Add no parameter test to call_info
This commit is contained in:
parent
7ba22f1c19
commit
ed65e2619a
@ -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…
Reference in New Issue
Block a user