aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src/helpers/insert_use/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_db/src/helpers/insert_use/tests.rs')
-rw-r--r--crates/ide_db/src/helpers/insert_use/tests.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ide_db/src/helpers/insert_use/tests.rs b/crates/ide_db/src/helpers/insert_use/tests.rs
index 248227d29..f99857a89 100644
--- a/crates/ide_db/src/helpers/insert_use/tests.rs
+++ b/crates/ide_db/src/helpers/insert_use/tests.rs
@@ -21,7 +21,7 @@ use crate::bar::A;
21use self::bar::A; 21use self::bar::A;
22use super::bar::A; 22use super::bar::A;
23use external_crate2::bar::A;", 23use external_crate2::bar::A;",
24 None, 24 ImportGranularity::Item,
25 false, 25 false,
26 false, 26 false,
27 ); 27 );
@@ -36,7 +36,7 @@ fn insert_not_group_empty() {
36 r"use external_crate2::bar::A; 36 r"use external_crate2::bar::A;
37 37
38", 38",
39 None, 39 ImportGranularity::Item,
40 false, 40 false,
41 false, 41 false,
42 ); 42 );
@@ -281,7 +281,7 @@ fn insert_empty_module() {
281 r"{ 281 r"{
282 use foo::bar; 282 use foo::bar;
283}", 283}",
284 None, 284 ImportGranularity::Item,
285 true, 285 true,
286 true, 286 true,
287 ) 287 )
@@ -635,7 +635,7 @@ fn check(
635 path: &str, 635 path: &str,
636 ra_fixture_before: &str, 636 ra_fixture_before: &str,
637 ra_fixture_after: &str, 637 ra_fixture_after: &str,
638 mb: Option<MergeBehavior>, 638 granularity: ImportGranularity,
639 module: bool, 639 module: bool,
640 group: bool, 640 group: bool,
641) { 641) {
@@ -651,21 +651,21 @@ fn check(
651 .find_map(ast::Path::cast) 651 .find_map(ast::Path::cast)
652 .unwrap(); 652 .unwrap();
653 653
654 insert_use(&file, path, InsertUseConfig { merge: mb, prefix_kind: PrefixKind::Plain, group }); 654 insert_use(&file, path, InsertUseConfig { granularity, prefix_kind: PrefixKind::Plain, group });
655 let result = file.as_syntax_node().to_string(); 655 let result = file.as_syntax_node().to_string();
656 assert_eq_text!(ra_fixture_after, &result); 656 assert_eq_text!(ra_fixture_after, &result);
657} 657}
658 658
659fn check_crate(path: &str, ra_fixture_before: &str, ra_fixture_after: &str) { 659fn check_crate(path: &str, ra_fixture_before: &str, ra_fixture_after: &str) {
660 check(path, ra_fixture_before, ra_fixture_after, Some(MergeBehavior::Crate), false, true) 660 check(path, ra_fixture_before, ra_fixture_after, ImportGranularity::Crate, false, true)
661} 661}
662 662
663fn check_module(path: &str, ra_fixture_before: &str, ra_fixture_after: &str) { 663fn check_module(path: &str, ra_fixture_before: &str, ra_fixture_after: &str) {
664 check(path, ra_fixture_before, ra_fixture_after, Some(MergeBehavior::Module), false, true) 664 check(path, ra_fixture_before, ra_fixture_after, ImportGranularity::Module, false, true)
665} 665}
666 666
667fn check_none(path: &str, ra_fixture_before: &str, ra_fixture_after: &str) { 667fn check_none(path: &str, ra_fixture_before: &str, ra_fixture_after: &str) {
668 check(path, ra_fixture_before, ra_fixture_after, None, false, true) 668 check(path, ra_fixture_before, ra_fixture_after, ImportGranularity::Item, false, true)
669} 669}
670 670
671fn check_merge_only_fail(ra_fixture0: &str, ra_fixture1: &str, mb: MergeBehavior) { 671fn check_merge_only_fail(ra_fixture0: &str, ra_fixture1: &str, mb: MergeBehavior) {