Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-db/src/imports/insert_use/tests.rs')
| -rw-r--r-- | crates/ide-db/src/imports/insert_use/tests.rs | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/crates/ide-db/src/imports/insert_use/tests.rs b/crates/ide-db/src/imports/insert_use/tests.rs index 81604b5527..decb0ea9d8 100644 --- a/crates/ide-db/src/imports/insert_use/tests.rs +++ b/crates/ide-db/src/imports/insert_use/tests.rs @@ -1244,8 +1244,8 @@ use ::ext::foo::Foo; fn check_with_config( path: &str, - ra_fixture_before: &str, - ra_fixture_after: &str, + #[rust_analyzer::rust_fixture] ra_fixture_before: &str, + #[rust_analyzer::rust_fixture] ra_fixture_after: &str, config: &InsertUseConfig, ) { let (db, file_id, pos) = if ra_fixture_before.contains(CURSOR_MARKER) { @@ -1277,8 +1277,8 @@ fn check_with_config( fn check( path: &str, - ra_fixture_before: &str, - ra_fixture_after: &str, + #[rust_analyzer::rust_fixture] ra_fixture_before: &str, + #[rust_analyzer::rust_fixture] ra_fixture_after: &str, granularity: ImportGranularity, ) { check_with_config( @@ -1295,19 +1295,35 @@ fn check( ) } -fn check_crate(path: &str, ra_fixture_before: &str, ra_fixture_after: &str) { +fn check_crate( + path: &str, + #[rust_analyzer::rust_fixture] ra_fixture_before: &str, + #[rust_analyzer::rust_fixture] ra_fixture_after: &str, +) { check(path, ra_fixture_before, ra_fixture_after, ImportGranularity::Crate) } -fn check_module(path: &str, ra_fixture_before: &str, ra_fixture_after: &str) { +fn check_module( + path: &str, + #[rust_analyzer::rust_fixture] ra_fixture_before: &str, + #[rust_analyzer::rust_fixture] ra_fixture_after: &str, +) { check(path, ra_fixture_before, ra_fixture_after, ImportGranularity::Module) } -fn check_none(path: &str, ra_fixture_before: &str, ra_fixture_after: &str) { +fn check_none( + path: &str, + #[rust_analyzer::rust_fixture] ra_fixture_before: &str, + #[rust_analyzer::rust_fixture] ra_fixture_after: &str, +) { check(path, ra_fixture_before, ra_fixture_after, ImportGranularity::Item) } -fn check_one(path: &str, ra_fixture_before: &str, ra_fixture_after: &str) { +fn check_one( + path: &str, + #[rust_analyzer::rust_fixture] ra_fixture_before: &str, + #[rust_analyzer::rust_fixture] ra_fixture_after: &str, +) { check(path, ra_fixture_before, ra_fixture_after, ImportGranularity::One) } @@ -1330,7 +1346,7 @@ fn check_merge_only_fail(ra_fixture0: &str, ra_fixture1: &str, mb: MergeBehavior assert_eq!(result.map(|u| u.to_string()), None); } -fn check_guess(ra_fixture: &str, expected: ImportGranularityGuess) { +fn check_guess(#[rust_analyzer::rust_fixture] ra_fixture: &str, expected: ImportGranularityGuess) { let syntax = ast::SourceFile::parse(ra_fixture, span::Edition::CURRENT).tree().syntax().clone(); let file = ImportScope::from(syntax).unwrap(); assert_eq!(super::guess_granularity_from_scope(&file), expected); |