mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 15:14:32 +00:00
Merge #6888
6888: Use standard test style r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
435d46b183
1 changed files with 67 additions and 62 deletions
|
@ -4,6 +4,7 @@ use rustc_hash::FxHashMap;
|
|||
use hir::{Adt, ModuleDef, PathResolution, Semantics, Struct};
|
||||
use ide_db::RootDatabase;
|
||||
use syntax::{algo, ast, match_ast, AstNode, SyntaxKind, SyntaxKind::*, SyntaxNode};
|
||||
use test_utils::mark;
|
||||
|
||||
use crate::{AssistContext, AssistId, AssistKind, Assists};
|
||||
|
||||
|
@ -38,6 +39,7 @@ fn reorder<R: AstNode>(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
|
|||
});
|
||||
|
||||
if sorted_fields == fields {
|
||||
mark::hit!(reorder_sorted_fields);
|
||||
return None;
|
||||
}
|
||||
|
||||
|
@ -107,12 +109,15 @@ fn compute_fields_ranks(path: &ast::Path, ctx: &AssistContext) -> Option<FxHashM
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use test_utils::mark;
|
||||
|
||||
use crate::tests::{check_assist, check_assist_not_applicable};
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn not_applicable_if_sorted() {
|
||||
fn reorder_sorted_fields() {
|
||||
mark::check!(reorder_sorted_fields);
|
||||
check_assist_not_applicable(
|
||||
reorder_fields,
|
||||
r#"
|
||||
|
|
Loading…
Reference in a new issue