diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2021-05-28 01:09:22 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2021-05-28 01:09:22 +0200 |
| commit | 411eee76147b0730e1eb5afe84d13558de2ee082 (patch) | |
| tree | 717431fe6b1e85e5b6d2a103f76dfc209a171f54 | |
| parent | 0724bd0f21e5f7294ee656a89597de9e6df65d29 (diff) | |
| download | rust-411eee76147b0730e1eb5afe84d13558de2ee082.tar.gz rust-411eee76147b0730e1eb5afe84d13558de2ee082.zip | |
Add another attribute completion test
| -rw-r--r-- | crates/ide_completion/src/completions/attribute.rs | 25 |
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 79a9c6d8714..8b018c32fd4 100644 --- a/crates/ide_completion/src/completions/attribute.rs +++ b/crates/ide_completion/src/completions/attribute.rs @@ -319,6 +319,26 @@ mod tests { } #[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( r#"#![$0]"#, @@ -731,9 +751,4 @@ mod tests { "#]], ); } - - #[test] - fn test_attribute_completion_inside_nested_attr() { - check(r#"#[cfg($0)]"#, expect![[]]) - } } |
