diff options
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r-- | crates/ra_assists/src/handlers/merge_imports.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/ra_assists/src/handlers/merge_imports.rs b/crates/ra_assists/src/handlers/merge_imports.rs index 9c5c6eda7..47d465404 100644 --- a/crates/ra_assists/src/handlers/merge_imports.rs +++ b/crates/ra_assists/src/handlers/merge_imports.rs | |||
@@ -165,6 +165,33 @@ use std::fmt::{Display, Debug}; | |||
165 | } | 165 | } |
166 | 166 | ||
167 | #[test] | 167 | #[test] |
168 | fn merge_self1() { | ||
169 | check_assist( | ||
170 | merge_imports, | ||
171 | r" | ||
172 | use std::fmt<|>; | ||
173 | use std::fmt::Display; | ||
174 | ", | ||
175 | r" | ||
176 | use std::fmt::{self, Display}; | ||
177 | ", | ||
178 | ); | ||
179 | } | ||
180 | |||
181 | #[test] | ||
182 | fn merge_self2() { | ||
183 | check_assist( | ||
184 | merge_imports, | ||
185 | r" | ||
186 | use std::{fmt, <|>fmt::Display}; | ||
187 | ", | ||
188 | r" | ||
189 | use std::{fmt::{Display, self}}; | ||
190 | ", | ||
191 | ); | ||
192 | } | ||
193 | |||
194 | #[test] | ||
168 | fn test_merge_nested() { | 195 | fn test_merge_nested() { |
169 | check_assist( | 196 | check_assist( |
170 | merge_imports, | 197 | merge_imports, |