diff options
Diffstat (limited to 'crates/assists/src/tests')
-rw-r--r-- | crates/assists/src/tests/generated.rs | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/crates/assists/src/tests/generated.rs b/crates/assists/src/tests/generated.rs index cc7c4a343..d3dfe24e7 100644 --- a/crates/assists/src/tests/generated.rs +++ b/crates/assists/src/tests/generated.rs | |||
@@ -42,26 +42,26 @@ fn doctest_add_impl_default_members() { | |||
42 | "add_impl_default_members", | 42 | "add_impl_default_members", |
43 | r#####" | 43 | r#####" |
44 | trait Trait { | 44 | trait Trait { |
45 | Type X; | 45 | type X; |
46 | fn foo(&self); | 46 | fn foo(&self); |
47 | fn bar(&self) {} | 47 | fn bar(&self) {} |
48 | } | 48 | } |
49 | 49 | ||
50 | impl Trait for () { | 50 | impl Trait for () { |
51 | Type X = (); | 51 | type X = (); |
52 | fn foo(&self) {}<|> | 52 | fn foo(&self) {}<|> |
53 | 53 | ||
54 | } | 54 | } |
55 | "#####, | 55 | "#####, |
56 | r#####" | 56 | r#####" |
57 | trait Trait { | 57 | trait Trait { |
58 | Type X; | 58 | type X; |
59 | fn foo(&self); | 59 | fn foo(&self); |
60 | fn bar(&self) {} | 60 | fn bar(&self) {} |
61 | } | 61 | } |
62 | 62 | ||
63 | impl Trait for () { | 63 | impl Trait for () { |
64 | Type X = (); | 64 | type X = (); |
65 | fn foo(&self) {} | 65 | fn foo(&self) {} |
66 | 66 | ||
67 | $0fn bar(&self) {} | 67 | $0fn bar(&self) {} |
@@ -76,7 +76,7 @@ fn doctest_add_impl_missing_members() { | |||
76 | "add_impl_missing_members", | 76 | "add_impl_missing_members", |
77 | r#####" | 77 | r#####" |
78 | trait Trait<T> { | 78 | trait Trait<T> { |
79 | Type X; | 79 | type X; |
80 | fn foo(&self) -> T; | 80 | fn foo(&self) -> T; |
81 | fn bar(&self) {} | 81 | fn bar(&self) {} |
82 | } | 82 | } |
@@ -87,14 +87,16 @@ impl Trait<u32> for () {<|> | |||
87 | "#####, | 87 | "#####, |
88 | r#####" | 88 | r#####" |
89 | trait Trait<T> { | 89 | trait Trait<T> { |
90 | Type X; | 90 | type X; |
91 | fn foo(&self) -> T; | 91 | fn foo(&self) -> T; |
92 | fn bar(&self) {} | 92 | fn bar(&self) {} |
93 | } | 93 | } |
94 | 94 | ||
95 | impl Trait<u32> for () { | 95 | impl Trait<u32> for () { |
96 | $0type X; | ||
97 | |||
96 | fn foo(&self) -> u32 { | 98 | fn foo(&self) -> u32 { |
97 | ${0:todo!()} | 99 | todo!() |
98 | } | 100 | } |
99 | } | 101 | } |
100 | "#####, | 102 | "#####, |
@@ -236,6 +238,21 @@ fn qux(bar: Bar, baz: Baz) {} | |||
236 | } | 238 | } |
237 | 239 | ||
238 | #[test] | 240 | #[test] |
241 | fn doctest_extract_module_to_file() { | ||
242 | check_doc_test( | ||
243 | "extract_module_to_file", | ||
244 | r#####" | ||
245 | mod foo {<|> | ||
246 | fn t() {} | ||
247 | } | ||
248 | "#####, | ||
249 | r#####" | ||
250 | mod foo; | ||
251 | "#####, | ||
252 | ) | ||
253 | } | ||
254 | |||
255 | #[test] | ||
239 | fn doctest_extract_struct_from_enum_variant() { | 256 | fn doctest_extract_struct_from_enum_variant() { |
240 | check_doc_test( | 257 | check_doc_test( |
241 | "extract_struct_from_enum_variant", | 258 | "extract_struct_from_enum_variant", |