Add another attribute completion test

This commit is contained in:
Lukas Wirth
2021-05-28 01:09:22 +02:00
parent 0724bd0f21
commit 411eee7614
@@ -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![[]])
}
}