mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Use upstream cov-mark
This commit is contained in:
parent
c5189a22cc
commit
fc9eed4836
101 changed files with 354 additions and 514 deletions
|
@ -7,7 +7,6 @@ use syntax::{
|
|||
ast::{self, ArgListOwner},
|
||||
match_ast, AstNode, SyntaxNode, SyntaxToken, TextRange, TextSize,
|
||||
};
|
||||
use test_utils::mark;
|
||||
|
||||
use crate::RootDatabase;
|
||||
|
||||
|
@ -122,7 +121,7 @@ fn call_info_impl(
|
|||
|
||||
let arg_list_range = arg_list.syntax().text_range();
|
||||
if !arg_list_range.contains_inclusive(token.text_range().start()) {
|
||||
mark::hit!(call_info_bad_offset);
|
||||
cov_mark::hit!(call_info_bad_offset);
|
||||
return None;
|
||||
}
|
||||
let param = std::cmp::min(
|
||||
|
@ -162,7 +161,7 @@ impl ActiveParameter {
|
|||
let idx = active_parameter?;
|
||||
let mut params = signature.params(sema.db);
|
||||
if !(idx < params.len()) {
|
||||
mark::hit!(too_many_arguments);
|
||||
cov_mark::hit!(too_many_arguments);
|
||||
return None;
|
||||
}
|
||||
let (pat, ty) = params.swap_remove(idx);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::RootDatabase;
|
||||
use base_db::{fixture::ChangeFixture, FilePosition};
|
||||
use expect_test::{expect, Expect};
|
||||
use test_utils::{mark, RangeOrOffset};
|
||||
use test_utils::RangeOrOffset;
|
||||
|
||||
/// Creates analysis from a multi-file fixture, returns positions marked with $0.
|
||||
pub(crate) fn position(ra_fixture: &str) -> (RootDatabase, FilePosition) {
|
||||
|
@ -347,7 +347,7 @@ pub fn foo(mut r: WriteHandler<()>) {
|
|||
|
||||
#[test]
|
||||
fn call_info_bad_offset() {
|
||||
mark::check!(call_info_bad_offset);
|
||||
cov_mark::check!(call_info_bad_offset);
|
||||
check(
|
||||
r#"
|
||||
fn foo(x: u32, y: u32) -> u32 {x + y}
|
||||
|
|
|
@ -13,7 +13,6 @@ use syntax::{
|
|||
},
|
||||
AstToken, InsertPosition, NodeOrToken, SyntaxElement, SyntaxNode, SyntaxToken,
|
||||
};
|
||||
use test_utils::mark;
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub struct InsertUseConfig {
|
||||
|
@ -138,7 +137,7 @@ pub fn insert_use<'a>(
|
|||
|
||||
if add_blank.has_before() {
|
||||
if let Some(indent) = indent.clone() {
|
||||
mark::hit!(insert_use_indent_before);
|
||||
cov_mark::hit!(insert_use_indent_before);
|
||||
buf.push(indent);
|
||||
}
|
||||
}
|
||||
|
@ -156,11 +155,11 @@ pub fn insert_use<'a>(
|
|||
// only add indentation *after* our stuff if there's another node directly after it
|
||||
if add_blank.has_after() && matches!(insert_position, InsertPosition::Before(_)) {
|
||||
if let Some(indent) = indent {
|
||||
mark::hit!(insert_use_indent_after);
|
||||
cov_mark::hit!(insert_use_indent_after);
|
||||
buf.push(indent);
|
||||
}
|
||||
} else if add_blank.has_after() && matches!(insert_position, InsertPosition::After(_)) {
|
||||
mark::hit!(insert_use_no_indent_after);
|
||||
cov_mark::hit!(insert_use_no_indent_after);
|
||||
}
|
||||
|
||||
buf
|
||||
|
|
|
@ -51,7 +51,7 @@ use std::bar::G;",
|
|||
|
||||
#[test]
|
||||
fn insert_start_indent() {
|
||||
mark::check!(insert_use_indent_after);
|
||||
cov_mark::check!(insert_use_indent_after);
|
||||
check_none(
|
||||
"std::bar::AA",
|
||||
r"
|
||||
|
@ -120,7 +120,7 @@ use std::bar::ZZ;",
|
|||
|
||||
#[test]
|
||||
fn insert_end_indent() {
|
||||
mark::check!(insert_use_indent_before);
|
||||
cov_mark::check!(insert_use_indent_before);
|
||||
check_none(
|
||||
"std::bar::ZZ",
|
||||
r"
|
||||
|
@ -255,7 +255,7 @@ fn insert_empty_file() {
|
|||
|
||||
#[test]
|
||||
fn insert_empty_module() {
|
||||
mark::check!(insert_use_no_indent_after);
|
||||
cov_mark::check!(insert_use_no_indent_after);
|
||||
check(
|
||||
"foo::bar",
|
||||
"mod x {}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue