From 411eee76147b0730e1eb5afe84d13558de2ee082 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 28 May 2021 01:09:22 +0200 Subject: Add another attribute completion test --- crates/ide_completion/src/completions/attribute.rs | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'crates/ide_completion/src/completions') diff --git a/crates/ide_completion/src/completions/attribute.rs b/crates/ide_completion/src/completions/attribute.rs index 79a9c6d87..8b018c32f 100644 --- a/crates/ide_completion/src/completions/attribute.rs +++ b/crates/ide_completion/src/completions/attribute.rs @@ -318,6 +318,26 @@ mod tests { 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 @@ mod tests { "#]], ); } - - #[test] - fn test_attribute_completion_inside_nested_attr() { - check(r#"#[cfg($0)]"#, expect![[]]) - } } -- cgit v1.2.3