aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists/src/tests/generated.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_assists/src/tests/generated.rs')
-rw-r--r--crates/ide_assists/src/tests/generated.rs51
1 files changed, 51 insertions, 0 deletions
diff --git a/crates/ide_assists/src/tests/generated.rs b/crates/ide_assists/src/tests/generated.rs
index 736027ff0..27a22ca10 100644
--- a/crates/ide_assists/src/tests/generated.rs
+++ b/crates/ide_assists/src/tests/generated.rs
@@ -206,6 +206,38 @@ const _: i32 = 0b1010;
206} 206}
207 207
208#[test] 208#[test]
209fn doctest_convert_into_to_from() {
210 check_doc_test(
211 "convert_into_to_from",
212 r#####"
213//- /lib.rs crate:core
214pub mod convert { pub trait Into<T> { pub fn into(self) -> T; } }
215//- /lib.rs crate:main deps:core
216use core::convert::Into;
217impl $0Into<Thing> for usize {
218 fn into(self) -> Thing {
219 Thing {
220 b: self.to_string(),
221 a: self
222 }
223 }
224}
225"#####,
226 r#####"
227use core::convert::Into;
228impl From<usize> for Thing {
229 fn from(val: usize) -> Self {
230 Thing {
231 b: val.to_string(),
232 a: val
233 }
234 }
235}
236"#####,
237 )
238}
239
240#[test]
209fn doctest_convert_iter_for_each_to_for() { 241fn doctest_convert_iter_for_each_to_for() {
210 check_doc_test( 242 check_doc_test(
211 "convert_iter_for_each_to_for", 243 "convert_iter_for_each_to_for",
@@ -329,6 +361,25 @@ enum A { One(One) }
329} 361}
330 362
331#[test] 363#[test]
364fn doctest_extract_type_alias() {
365 check_doc_test(
366 "extract_type_alias",
367 r#####"
368struct S {
369 field: $0(u8, u8, u8)$0,
370}
371"#####,
372 r#####"
373type $0Type = (u8, u8, u8);
374
375struct S {
376 field: Type,
377}
378"#####,
379 )
380}
381
382#[test]
332fn doctest_extract_variable() { 383fn doctest_extract_variable() {
333 check_doc_test( 384 check_doc_test(
334 "extract_variable", 385 "extract_variable",