Unnamed repository; edit this file 'description' to name the repository.
Add missing test for use completions
Lukas Wirth 2022-02-03
parent 136dada · commit a3ad996
-rw-r--r--crates/ide_completion/src/tests/use_tree.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ide_completion/src/tests/use_tree.rs b/crates/ide_completion/src/tests/use_tree.rs
index ac7e75bd38..73cb83957f 100644
--- a/crates/ide_completion/src/tests/use_tree.rs
+++ b/crates/ide_completion/src/tests/use_tree.rs
@@ -32,6 +32,25 @@ mod foo {}
}
#[test]
+fn use_tree_start_abs() {
+ cov_mark::check!(use_tree_crate_roots_only);
+ check(
+ r#"
+//- /lib.rs crate:main deps:other_crate
+use ::f$0
+
+struct Foo;
+mod foo {}
+//- /other_crate/lib.rs crate:other_crate
+// nothing here
+"#,
+ expect![[r#"
+ md other_crate
+ "#]],
+ );
+}
+
+#[test]
fn dont_complete_current_use() {
cov_mark::check!(dont_complete_current_use);
check(r#"use self::foo$0;"#, expect![[r#""#]]);