diff options
author | unexge <[email protected]> | 2021-01-15 19:57:10 +0000 |
---|---|---|
committer | unexge <[email protected]> | 2021-01-15 19:57:10 +0000 |
commit | cbe93359545611a34bb1a6a8e99ff4621deb1197 (patch) | |
tree | 6f205fb2242311173f8ac21c8e896b1da35b7b44 /crates/assists/src/handlers | |
parent | c303014f3923e46ae63fbcdc6cf6f166bb040b1e (diff) |
Add test mark for skipping single use item
Diffstat (limited to 'crates/assists/src/handlers')
-rw-r--r-- | crates/assists/src/handlers/unmerge_use.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/assists/src/handlers/unmerge_use.rs b/crates/assists/src/handlers/unmerge_use.rs index 6da1795da..3dbef8e51 100644 --- a/crates/assists/src/handlers/unmerge_use.rs +++ b/crates/assists/src/handlers/unmerge_use.rs | |||
@@ -3,6 +3,7 @@ use syntax::{ | |||
3 | ast::{self, edit::AstNodeEdit, VisibilityOwner}, | 3 | ast::{self, edit::AstNodeEdit, VisibilityOwner}, |
4 | AstNode, SyntaxKind, | 4 | AstNode, SyntaxKind, |
5 | }; | 5 | }; |
6 | use test_utils::mark; | ||
6 | 7 | ||
7 | use crate::{ | 8 | use crate::{ |
8 | assist_context::{AssistContext, Assists}, | 9 | assist_context::{AssistContext, Assists}, |
@@ -26,6 +27,7 @@ pub(crate) fn unmerge_use(acc: &mut Assists, ctx: &AssistContext) -> Option<()> | |||
26 | 27 | ||
27 | let tree_list = tree.syntax().parent().and_then(ast::UseTreeList::cast)?; | 28 | let tree_list = tree.syntax().parent().and_then(ast::UseTreeList::cast)?; |
28 | if tree_list.use_trees().count() < 2 { | 29 | if tree_list.use_trees().count() < 2 { |
30 | mark::hit!(skip_single_use_item); | ||
29 | return None; | 31 | return None; |
30 | } | 32 | } |
31 | 33 | ||
@@ -87,6 +89,7 @@ mod tests { | |||
87 | 89 | ||
88 | #[test] | 90 | #[test] |
89 | fn skip_single_use_item() { | 91 | fn skip_single_use_item() { |
92 | mark::check!(skip_single_use_item); | ||
90 | check_assist_not_applicable( | 93 | check_assist_not_applicable( |
91 | unmerge_use, | 94 | unmerge_use, |
92 | r" | 95 | r" |