diff options
author | Aleksey Kladov <[email protected]> | 2019-10-27 09:22:53 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-10-27 09:23:22 +0000 |
commit | da5528824a836a4f36f44f90adc9fadcc98ca75b (patch) | |
tree | 0e12aa5d4bcdfb609faa76e01e49854ac95ccadd /crates/ra_assists/src/doc_tests | |
parent | a455635b48b9b43904488bb33454c67e513bccf7 (diff) |
document almost all assists
Diffstat (limited to 'crates/ra_assists/src/doc_tests')
-rw-r--r-- | crates/ra_assists/src/doc_tests/generated.rs | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/crates/ra_assists/src/doc_tests/generated.rs b/crates/ra_assists/src/doc_tests/generated.rs index 09677af68..b8d335911 100644 --- a/crates/ra_assists/src/doc_tests/generated.rs +++ b/crates/ra_assists/src/doc_tests/generated.rs | |||
@@ -40,6 +40,23 @@ fn main() { | |||
40 | } | 40 | } |
41 | 41 | ||
42 | #[test] | 42 | #[test] |
43 | fn doctest_add_hash() { | ||
44 | check( | ||
45 | "add_hash", | ||
46 | r#####" | ||
47 | fn main() { | ||
48 | r#"Hello,<|> World!"#; | ||
49 | } | ||
50 | "#####, | ||
51 | r#####" | ||
52 | fn main() { | ||
53 | r##"Hello, World!"##; | ||
54 | } | ||
55 | "#####, | ||
56 | ) | ||
57 | } | ||
58 | |||
59 | #[test] | ||
43 | fn doctest_add_impl() { | 60 | fn doctest_add_impl() { |
44 | check( | 61 | check( |
45 | "add_impl", | 62 | "add_impl", |
@@ -275,6 +292,40 @@ fn main() { | |||
275 | } | 292 | } |
276 | 293 | ||
277 | #[test] | 294 | #[test] |
295 | fn doctest_make_raw_string() { | ||
296 | check( | ||
297 | "make_raw_string", | ||
298 | r#####" | ||
299 | fn main() { | ||
300 | "Hello,<|> World!"; | ||
301 | } | ||
302 | "#####, | ||
303 | r#####" | ||
304 | fn main() { | ||
305 | r#"Hello, World!"#; | ||
306 | } | ||
307 | "#####, | ||
308 | ) | ||
309 | } | ||
310 | |||
311 | #[test] | ||
312 | fn doctest_make_usual_string() { | ||
313 | check( | ||
314 | "make_usual_string", | ||
315 | r#####" | ||
316 | fn main() { | ||
317 | r#"Hello,<|> "World!""#; | ||
318 | } | ||
319 | "#####, | ||
320 | r#####" | ||
321 | fn main() { | ||
322 | "Hello, \"World!\""; | ||
323 | } | ||
324 | "#####, | ||
325 | ) | ||
326 | } | ||
327 | |||
328 | #[test] | ||
278 | fn doctest_merge_match_arms() { | 329 | fn doctest_merge_match_arms() { |
279 | check( | 330 | check( |
280 | "merge_match_arms", | 331 | "merge_match_arms", |
@@ -370,3 +421,78 @@ fn handle(action: Action) { | |||
370 | "#####, | 421 | "#####, |
371 | ) | 422 | ) |
372 | } | 423 | } |
424 | |||
425 | #[test] | ||
426 | fn doctest_remove_dbg() { | ||
427 | check( | ||
428 | "remove_dbg", | ||
429 | r#####" | ||
430 | fn main() { | ||
431 | <|>dbg!(92); | ||
432 | } | ||
433 | "#####, | ||
434 | r#####" | ||
435 | fn main() { | ||
436 | 92; | ||
437 | } | ||
438 | "#####, | ||
439 | ) | ||
440 | } | ||
441 | |||
442 | #[test] | ||
443 | fn doctest_remove_hash() { | ||
444 | check( | ||
445 | "remove_hash", | ||
446 | r#####" | ||
447 | fn main() { | ||
448 | r#"Hello,<|> World!"#; | ||
449 | } | ||
450 | "#####, | ||
451 | r#####" | ||
452 | fn main() { | ||
453 | r"Hello, World!"; | ||
454 | } | ||
455 | "#####, | ||
456 | ) | ||
457 | } | ||
458 | |||
459 | #[test] | ||
460 | fn doctest_replace_if_let_with_match() { | ||
461 | check( | ||
462 | "replace_if_let_with_match", | ||
463 | r#####" | ||
464 | enum Action { Move { distance: u32 }, Stop } | ||
465 | |||
466 | fn handle(action: Action) { | ||
467 | <|>if let Action::Move { distance } = action { | ||
468 | foo(distance) | ||
469 | } else { | ||
470 | bar() | ||
471 | } | ||
472 | } | ||
473 | "#####, | ||
474 | r#####" | ||
475 | enum Action { Move { distance: u32 }, Stop } | ||
476 | |||
477 | fn handle(action: Action) { | ||
478 | match action { | ||
479 | Action::Move { distance } => foo(distance), | ||
480 | _ => bar(), | ||
481 | } | ||
482 | } | ||
483 | "#####, | ||
484 | ) | ||
485 | } | ||
486 | |||
487 | #[test] | ||
488 | fn doctest_split_import() { | ||
489 | check( | ||
490 | "split_import", | ||
491 | r#####" | ||
492 | use std::<|>collections::HashMap; | ||
493 | "#####, | ||
494 | r#####" | ||
495 | use std::{collections::HashMap}; | ||
496 | "#####, | ||
497 | ) | ||
498 | } | ||