From a3ad99649ff8c3f1d10a6f3cd822d15b985c10df Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 2 Feb 2022 15:28:23 +0100 Subject: [PATCH] Add missing test for use completions --- crates/ide_completion/src/tests/use_tree.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 @@ -31,6 +31,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);