Skip to content

Commit 411eee7

Browse files
committed
Add another attribute completion test
1 parent 0724bd0 commit 411eee7

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

crates/ide_completion/src/completions/attribute.rs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,26 @@ mod tests {
318318
expect.assert_eq(&actual);
319319
}
320320

321+
#[test]
322+
fn test_attribute_completion_inside_nested_attr() {
323+
check(r#"#[cfg($0)]"#, expect![[]])
324+
}
325+
326+
#[test]
327+
fn test_attribute_completion_with_existing_attr() {
328+
check(
329+
r#"#[no_mangle] #[$0] mcall!();"#,
330+
expect![[r#"
331+
at allow(…)
332+
at cfg(…)
333+
at cfg_attr(…)
334+
at deny(…)
335+
at forbid(…)
336+
at warn(…)
337+
"#]],
338+
)
339+
}
340+
321341
#[test]
322342
fn complete_attribute_on_source_file() {
323343
check(
@@ -731,9 +751,4 @@ mod tests {
731751
"#]],
732752
);
733753
}
734-
735-
#[test]
736-
fn test_attribute_completion_inside_nested_attr() {
737-
check(r#"#[cfg($0)]"#, expect![[]])
738-
}
739754
}

0 commit comments

Comments
 (0)