diff options
Diffstat (limited to 'crates/ra_assists/src/tests')
-rw-r--r-- | crates/ra_assists/src/tests/generated.rs | 69 |
1 files changed, 44 insertions, 25 deletions
diff --git a/crates/ra_assists/src/tests/generated.rs b/crates/ra_assists/src/tests/generated.rs index abffbf97c..d17504529 100644 --- a/crates/ra_assists/src/tests/generated.rs +++ b/crates/ra_assists/src/tests/generated.rs | |||
@@ -59,6 +59,25 @@ fn main() { | |||
59 | } | 59 | } |
60 | 60 | ||
61 | #[test] | 61 | #[test] |
62 | fn doctest_add_from_impl_for_enum() { | ||
63 | check_doc_test( | ||
64 | "add_from_impl_for_enum", | ||
65 | r#####" | ||
66 | enum A { <|>One(u32) } | ||
67 | "#####, | ||
68 | r#####" | ||
69 | enum A { One(u32) } | ||
70 | |||
71 | impl From<u32> for A { | ||
72 | fn from(v: u32) -> Self { | ||
73 | A::One(v) | ||
74 | } | ||
75 | } | ||
76 | "#####, | ||
77 | ) | ||
78 | } | ||
79 | |||
80 | #[test] | ||
62 | fn doctest_add_function() { | 81 | fn doctest_add_function() { |
63 | check_doc_test( | 82 | check_doc_test( |
64 | "add_function", | 83 | "add_function", |
@@ -269,31 +288,6 @@ pub mod std { pub mod collections { pub struct HashMap { } } } | |||
269 | } | 288 | } |
270 | 289 | ||
271 | #[test] | 290 | #[test] |
272 | fn doctest_change_lifetime_anon_to_named() { | ||
273 | check_doc_test( | ||
274 | "change_lifetime_anon_to_named", | ||
275 | r#####" | ||
276 | impl Cursor<'_<|>> { | ||
277 | fn node(self) -> &SyntaxNode { | ||
278 | match self { | ||
279 | Cursor::Replace(node) | Cursor::Before(node) => node, | ||
280 | } | ||
281 | } | ||
282 | } | ||
283 | "#####, | ||
284 | r#####" | ||
285 | impl<'a> Cursor<'a> { | ||
286 | fn node(self) -> &SyntaxNode { | ||
287 | match self { | ||
288 | Cursor::Replace(node) | Cursor::Before(node) => node, | ||
289 | } | ||
290 | } | ||
291 | } | ||
292 | "#####, | ||
293 | ) | ||
294 | } | ||
295 | |||
296 | #[test] | ||
297 | fn doctest_change_return_type_to_result() { | 291 | fn doctest_change_return_type_to_result() { |
298 | check_doc_test( | 292 | check_doc_test( |
299 | "change_return_type_to_result", | 293 | "change_return_type_to_result", |
@@ -458,6 +452,31 @@ fn main() { | |||
458 | } | 452 | } |
459 | 453 | ||
460 | #[test] | 454 | #[test] |
455 | fn doctest_introduce_named_lifetime() { | ||
456 | check_doc_test( | ||
457 | "introduce_named_lifetime", | ||
458 | r#####" | ||
459 | impl Cursor<'_<|>> { | ||
460 | fn node(self) -> &SyntaxNode { | ||
461 | match self { | ||
462 | Cursor::Replace(node) | Cursor::Before(node) => node, | ||
463 | } | ||
464 | } | ||
465 | } | ||
466 | "#####, | ||
467 | r#####" | ||
468 | impl<'a> Cursor<'a> { | ||
469 | fn node(self) -> &SyntaxNode { | ||
470 | match self { | ||
471 | Cursor::Replace(node) | Cursor::Before(node) => node, | ||
472 | } | ||
473 | } | ||
474 | } | ||
475 | "#####, | ||
476 | ) | ||
477 | } | ||
478 | |||
479 | #[test] | ||
461 | fn doctest_introduce_variable() { | 480 | fn doctest_introduce_variable() { |
462 | check_doc_test( | 481 | check_doc_test( |
463 | "introduce_variable", | 482 | "introduce_variable", |