aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-05-28 00:09:22 +0100
committerLukas Wirth <[email protected]>2021-05-28 00:09:22 +0100
commit411eee76147b0730e1eb5afe84d13558de2ee082 (patch)
tree717431fe6b1e85e5b6d2a103f76dfc209a171f54 /crates/ide_completion/src/completions
parent0724bd0f21e5f7294ee656a89597de9e6df65d29 (diff)
Add another attribute completion test
Diffstat (limited to 'crates/ide_completion/src/completions')
-rw-r--r--crates/ide_completion/src/completions/attribute.rs25
1 files changed, 20 insertions, 5 deletions
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
@@ -319,6 +319,26 @@ mod tests {
319 } 319 }
320 320
321 #[test] 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
341 #[test]
322 fn complete_attribute_on_source_file() { 342 fn complete_attribute_on_source_file() {
323 check( 343 check(
324 r#"#![$0]"#, 344 r#"#![$0]"#,
@@ -731,9 +751,4 @@ mod tests {
731 "#]], 751 "#]],
732 ); 752 );
733 } 753 }
734
735 #[test]
736 fn test_attribute_completion_inside_nested_attr() {
737 check(r#"#[cfg($0)]"#, expect![[]])
738 }
739} 754}