mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Add a basic test for the trait fuzzy import
This commit is contained in:
parent
6f8af890ed
commit
1bfc3a50c0
1 changed files with 24 additions and 0 deletions
|
@ -748,6 +748,30 @@ mod tests {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fuzzy_import_trait() {
|
||||||
|
let ra_fixture = r#"
|
||||||
|
//- /main.rs crate:main deps:dep
|
||||||
|
//- /dep.rs crate:dep
|
||||||
|
pub mod fmt {
|
||||||
|
pub trait Display {
|
||||||
|
fn fmttt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"#;
|
||||||
|
|
||||||
|
check_search(
|
||||||
|
ra_fixture,
|
||||||
|
"main",
|
||||||
|
Query::new("fmt".to_string()).search_mode(SearchMode::Fuzzy),
|
||||||
|
expect![[r#"
|
||||||
|
dep::fmt (t)
|
||||||
|
dep::fmt::Display (t)
|
||||||
|
dep::fmt::Display::fmttt (f)
|
||||||
|
"#]],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn search_mode() {
|
fn search_mode() {
|
||||||
let ra_fixture = r#"
|
let ra_fixture = r#"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue