From 647683b9bbbbac209b7cb1d2d1c2e1d50ffdfd11 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Apr 2020 01:48:32 +0200 Subject: Add test marks --- crates/ra_ide/src/completion/presentation.rs | 4 ++++ crates/ra_ide/src/marks.rs | 2 ++ 2 files changed, 6 insertions(+) (limited to 'crates') diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs index 6c0e32408..78df9cbdb 100644 --- a/crates/ra_ide/src/completion/presentation.rs +++ b/crates/ra_ide/src/completion/presentation.rs @@ -311,12 +311,14 @@ pub(crate) fn compute_score( name: &str, ) -> Option { let (active_name, active_type) = if let Some(record_field) = &ctx.record_field_syntax { + tested_by!(test_struct_field_completion_in_record_lit); let (struct_field, _local) = ctx.sema.resolve_record_field(record_field)?; ( struct_field.name(ctx.db).to_string(), struct_field.signature_ty(ctx.db).display(ctx.db).to_string(), ) } else if let Some(active_parameter) = &ctx.active_parameter { + tested_by!(test_struct_field_completion_in_func_call); (active_parameter.name.clone(), active_parameter.ty.clone()) } else { return None; @@ -1072,6 +1074,7 @@ mod tests { #[test] fn test_struct_field_completion_in_func_call() { + covers!(test_struct_field_completion_in_func_call); assert_debug_snapshot!( do_reference_completion( r" @@ -1161,6 +1164,7 @@ mod tests { #[test] fn test_struct_field_completion_in_record_lit() { + covers!(test_struct_field_completion_in_func_call); assert_debug_snapshot!( do_reference_completion( r" diff --git a/crates/ra_ide/src/marks.rs b/crates/ra_ide/src/marks.rs index eee44e886..bea30fe2a 100644 --- a/crates/ra_ide/src/marks.rs +++ b/crates/ra_ide/src/marks.rs @@ -9,4 +9,6 @@ test_utils::marks!( search_filters_by_range dont_insert_macro_call_parens_unncessary self_fulfilling_completion + test_struct_field_completion_in_func_call + test_struct_field_completion_in_record_lit ); -- cgit v1.2.3