Add a basic test for the trait fuzzy import

This commit is contained in:
Kirill Bulatov 2020-12-31 02:18:15 +02:00
parent 6f8af890ed
commit 1bfc3a50c0

View File

@ -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]
fn search_mode() {
let ra_fixture = r#"