mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
Add test marks
This commit is contained in:
@@ -311,12 +311,14 @@ pub(crate) fn compute_score(
|
||||
name: &str,
|
||||
) -> Option<CompletionScore> {
|
||||
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 @@ fn main() {
|
||||
|
||||
#[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 @@ fn foo(a: A) {
|
||||
|
||||
#[test]
|
||||
fn test_struct_field_completion_in_record_lit() {
|
||||
covers!(test_struct_field_completion_in_func_call);
|
||||
assert_debug_snapshot!(
|
||||
do_reference_completion(
|
||||
r"
|
||||
|
||||
@@ -9,4 +9,6 @@
|
||||
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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user