mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
Add another attribute completion test
This commit is contained in:
@@ -318,6 +318,26 @@ fn check(ra_fixture: &str, expect: Expect) {
|
||||
expect.assert_eq(&actual);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_attribute_completion_inside_nested_attr() {
|
||||
check(r#"#[cfg($0)]"#, expect![[]])
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_attribute_completion_with_existing_attr() {
|
||||
check(
|
||||
r#"#[no_mangle] #[$0] mcall!();"#,
|
||||
expect![[r#"
|
||||
at allow(…)
|
||||
at cfg(…)
|
||||
at cfg_attr(…)
|
||||
at deny(…)
|
||||
at forbid(…)
|
||||
at warn(…)
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn complete_attribute_on_source_file() {
|
||||
check(
|
||||
@@ -731,9 +751,4 @@ fn complete_attribute_on_expr() {
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_attribute_completion_inside_nested_attr() {
|
||||
check(r#"#[cfg($0)]"#, expect![[]])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user