diff options
author | Kirill Bulatov <[email protected]> | 2020-12-31 00:18:15 +0000 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2021-01-04 15:44:27 +0000 |
commit | 1bfc3a50c0febbfa9b56de01997d081814d98e39 (patch) | |
tree | d77dab8213291a6490ce7a6eff6371d2f6602dff /crates/hir_def | |
parent | 6f8af890ed9e3998b034c52157baf21db2a78227 (diff) |
Add a basic test for the trait fuzzy import
Diffstat (limited to 'crates/hir_def')
-rw-r--r-- | crates/hir_def/src/import_map.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/hir_def/src/import_map.rs b/crates/hir_def/src/import_map.rs index 30b22f51d..810a4a268 100644 --- a/crates/hir_def/src/import_map.rs +++ b/crates/hir_def/src/import_map.rs | |||
@@ -749,6 +749,30 @@ mod tests { | |||
749 | } | 749 | } |
750 | 750 | ||
751 | #[test] | 751 | #[test] |
752 | fn fuzzy_import_trait() { | ||
753 | let ra_fixture = r#" | ||
754 | //- /main.rs crate:main deps:dep | ||
755 | //- /dep.rs crate:dep | ||
756 | pub mod fmt { | ||
757 | pub trait Display { | ||
758 | fn fmttt(); | ||
759 | } | ||
760 | } | ||
761 | "#; | ||
762 | |||
763 | check_search( | ||
764 | ra_fixture, | ||
765 | "main", | ||
766 | Query::new("fmt".to_string()).search_mode(SearchMode::Fuzzy), | ||
767 | expect![[r#" | ||
768 | dep::fmt (t) | ||
769 | dep::fmt::Display (t) | ||
770 | dep::fmt::Display::fmttt (f) | ||
771 | "#]], | ||
772 | ); | ||
773 | } | ||
774 | |||
775 | #[test] | ||
752 | fn search_mode() { | 776 | fn search_mode() { |
753 | let ra_fixture = r#" | 777 | let ra_fixture = r#" |
754 | //- /main.rs crate:main deps:dep | 778 | //- /main.rs crate:main deps:dep |