mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-01 07:48:45 +00:00
Use check_count! instead of multiple check! in separate scopes
Changes are based on the review feedback by Veykril.
This commit is contained in:
parent
0cc079f3e9
commit
156f9074e1
1 changed files with 69 additions and 78 deletions
|
@ -302,9 +302,9 @@ fn main() {}",
|
|||
|
||||
#[test]
|
||||
fn insert_empty_file() {
|
||||
{
|
||||
cov_mark::check_count!(insert_empty_file, 2);
|
||||
|
||||
// Default configuration
|
||||
cov_mark::check!(insert_empty_file);
|
||||
// empty files will get two trailing newlines
|
||||
// this is due to the test case insert_no_imports above
|
||||
check_crate(
|
||||
|
@ -314,10 +314,8 @@ fn insert_empty_file() {
|
|||
|
||||
",
|
||||
);
|
||||
}
|
||||
{
|
||||
|
||||
// "not group" configuration
|
||||
cov_mark::check!(insert_empty_file);
|
||||
check_with_config(
|
||||
"use external_crate2::bar::A",
|
||||
r"",
|
||||
|
@ -333,13 +331,12 @@ fn insert_empty_file() {
|
|||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn insert_empty_module() {
|
||||
{
|
||||
cov_mark::check_count!(insert_empty_module, 2);
|
||||
|
||||
// Default configuration
|
||||
cov_mark::check!(insert_empty_module);
|
||||
check(
|
||||
"foo::bar",
|
||||
r"
|
||||
|
@ -352,10 +349,8 @@ mod x {
|
|||
",
|
||||
ImportGranularity::Item,
|
||||
);
|
||||
}
|
||||
{
|
||||
|
||||
// "not group" configuration
|
||||
cov_mark::check!(insert_empty_module);
|
||||
check_with_config(
|
||||
"foo::bar",
|
||||
r"mod x {$0}",
|
||||
|
@ -371,13 +366,12 @@ mod x {
|
|||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn insert_after_inner_attr() {
|
||||
{
|
||||
cov_mark::check_count!(insert_empty_inner_attr, 2);
|
||||
|
||||
// Default configuration
|
||||
cov_mark::check!(insert_empty_inner_attr);
|
||||
check_crate(
|
||||
"foo::bar",
|
||||
r"#![allow(unused_imports)]",
|
||||
|
@ -385,10 +379,8 @@ fn insert_after_inner_attr() {
|
|||
|
||||
use foo::bar;",
|
||||
);
|
||||
}
|
||||
{
|
||||
|
||||
// "not group" configuration
|
||||
cov_mark::check!(insert_empty_inner_attr);
|
||||
check_with_config(
|
||||
"foo::bar",
|
||||
r"#![allow(unused_imports)]",
|
||||
|
@ -404,7 +396,6 @@ use foo::bar;",
|
|||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn insert_after_inner_attr2() {
|
||||
|
|
Loading…
Reference in a new issue