diff options
Diffstat (limited to 'crates/ide_ssr/src/tests.rs')
-rw-r--r-- | crates/ide_ssr/src/tests.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/ide_ssr/src/tests.rs b/crates/ide_ssr/src/tests.rs index a3ea44f23..1d8565dc0 100644 --- a/crates/ide_ssr/src/tests.rs +++ b/crates/ide_ssr/src/tests.rs | |||
@@ -3,7 +3,7 @@ use expect_test::{expect, Expect}; | |||
3 | use ide_db::base_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt}; | 3 | use ide_db::base_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt}; |
4 | use rustc_hash::FxHashSet; | 4 | use rustc_hash::FxHashSet; |
5 | use std::sync::Arc; | 5 | use std::sync::Arc; |
6 | use test_utils::{mark, RangeOrOffset}; | 6 | use test_utils::RangeOrOffset; |
7 | 7 | ||
8 | fn parse_error_text(query: &str) -> String { | 8 | fn parse_error_text(query: &str) -> String { |
9 | format!("{}", query.parse::<SsrRule>().unwrap_err()) | 9 | format!("{}", query.parse::<SsrRule>().unwrap_err()) |
@@ -492,7 +492,7 @@ fn match_resolved_type_name() { | |||
492 | 492 | ||
493 | #[test] | 493 | #[test] |
494 | fn type_arguments_within_path() { | 494 | fn type_arguments_within_path() { |
495 | mark::check!(type_arguments_within_path); | 495 | cov_mark::check!(type_arguments_within_path); |
496 | let code = r#" | 496 | let code = r#" |
497 | mod foo { | 497 | mod foo { |
498 | pub struct Bar<T> {t: T} | 498 | pub struct Bar<T> {t: T} |
@@ -508,7 +508,7 @@ fn type_arguments_within_path() { | |||
508 | 508 | ||
509 | #[test] | 509 | #[test] |
510 | fn literal_constraint() { | 510 | fn literal_constraint() { |
511 | mark::check!(literal_constraint); | 511 | cov_mark::check!(literal_constraint); |
512 | let code = r#" | 512 | let code = r#" |
513 | enum Option<T> { Some(T), None } | 513 | enum Option<T> { Some(T), None } |
514 | use Option::Some; | 514 | use Option::Some; |
@@ -641,7 +641,7 @@ fn replace_associated_function_call() { | |||
641 | 641 | ||
642 | #[test] | 642 | #[test] |
643 | fn replace_associated_trait_default_function_call() { | 643 | fn replace_associated_trait_default_function_call() { |
644 | mark::check!(replace_associated_trait_default_function_call); | 644 | cov_mark::check!(replace_associated_trait_default_function_call); |
645 | assert_ssr_transform( | 645 | assert_ssr_transform( |
646 | "Bar2::foo() ==>> Bar2::foo2()", | 646 | "Bar2::foo() ==>> Bar2::foo2()", |
647 | r#" | 647 | r#" |
@@ -673,7 +673,7 @@ fn replace_associated_trait_default_function_call() { | |||
673 | 673 | ||
674 | #[test] | 674 | #[test] |
675 | fn replace_associated_trait_constant() { | 675 | fn replace_associated_trait_constant() { |
676 | mark::check!(replace_associated_trait_constant); | 676 | cov_mark::check!(replace_associated_trait_constant); |
677 | assert_ssr_transform( | 677 | assert_ssr_transform( |
678 | "Bar2::VALUE ==>> Bar2::VALUE_2222", | 678 | "Bar2::VALUE ==>> Bar2::VALUE_2222", |
679 | r#" | 679 | r#" |
@@ -998,7 +998,7 @@ fn use_declaration_with_braces() { | |||
998 | // It would be OK for a path rule to match and alter a use declaration. We shouldn't mess it up | 998 | // It would be OK for a path rule to match and alter a use declaration. We shouldn't mess it up |
999 | // though. In particular, we must not change `use foo::{baz, bar}` to `use foo::{baz, | 999 | // though. In particular, we must not change `use foo::{baz, bar}` to `use foo::{baz, |
1000 | // foo2::bar2}`. | 1000 | // foo2::bar2}`. |
1001 | mark::check!(use_declaration_with_braces); | 1001 | cov_mark::check!(use_declaration_with_braces); |
1002 | assert_ssr_transform( | 1002 | assert_ssr_transform( |
1003 | "foo::bar ==>> foo2::bar2", | 1003 | "foo::bar ==>> foo2::bar2", |
1004 | r#" | 1004 | r#" |
@@ -1076,7 +1076,7 @@ fn ufcs_matches_method_call() { | |||
1076 | 1076 | ||
1077 | #[test] | 1077 | #[test] |
1078 | fn pattern_is_a_single_segment_path() { | 1078 | fn pattern_is_a_single_segment_path() { |
1079 | mark::check!(pattern_is_a_single_segment_path); | 1079 | cov_mark::check!(pattern_is_a_single_segment_path); |
1080 | // The first function should not be altered because the `foo` in scope at the cursor position is | 1080 | // The first function should not be altered because the `foo` in scope at the cursor position is |
1081 | // a different `foo`. This case is special because "foo" can be parsed as a pattern (IDENT_PAT -> | 1081 | // a different `foo`. This case is special because "foo" can be parsed as a pattern (IDENT_PAT -> |
1082 | // NAME -> IDENT), which contains no path. If we're not careful we'll end up matching the `foo` | 1082 | // NAME -> IDENT), which contains no path. If we're not careful we'll end up matching the `foo` |
@@ -1118,7 +1118,7 @@ fn replace_local_variable_reference() { | |||
1118 | // The pattern references a local variable `foo` in the block containing the cursor. We should | 1118 | // The pattern references a local variable `foo` in the block containing the cursor. We should |
1119 | // only replace references to this variable `foo`, not other variables that just happen to have | 1119 | // only replace references to this variable `foo`, not other variables that just happen to have |
1120 | // the same name. | 1120 | // the same name. |
1121 | mark::check!(cursor_after_semicolon); | 1121 | cov_mark::check!(cursor_after_semicolon); |
1122 | assert_ssr_transform( | 1122 | assert_ssr_transform( |
1123 | "foo + $a ==>> $a - foo", | 1123 | "foo + $a ==>> $a - foo", |
1124 | r#" | 1124 | r#" |
@@ -1179,7 +1179,7 @@ fn replace_path_within_selection() { | |||
1179 | 1179 | ||
1180 | #[test] | 1180 | #[test] |
1181 | fn replace_nonpath_within_selection() { | 1181 | fn replace_nonpath_within_selection() { |
1182 | mark::check!(replace_nonpath_within_selection); | 1182 | cov_mark::check!(replace_nonpath_within_selection); |
1183 | assert_ssr_transform( | 1183 | assert_ssr_transform( |
1184 | "$a + $b ==>> $b * $a", | 1184 | "$a + $b ==>> $b * $a", |
1185 | r#" | 1185 | r#" |
@@ -1269,7 +1269,7 @@ fn replace_autoref_autoderef_capture() { | |||
1269 | // second, we already have a reference, so it isn't. When $a is used in a context where autoref | 1269 | // second, we already have a reference, so it isn't. When $a is used in a context where autoref |
1270 | // doesn't apply, we need to prefix it with `&`. Finally, we have some cases where autoderef | 1270 | // doesn't apply, we need to prefix it with `&`. Finally, we have some cases where autoderef |
1271 | // needs to be applied. | 1271 | // needs to be applied. |
1272 | mark::check!(replace_autoref_autoderef_capture); | 1272 | cov_mark::check!(replace_autoref_autoderef_capture); |
1273 | let code = r#" | 1273 | let code = r#" |
1274 | struct Foo {} | 1274 | struct Foo {} |
1275 | impl Foo { | 1275 | impl Foo { |