diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_assists/src/tests.rs | 2 | ||||
-rw-r--r-- | crates/ra_assists/src/tests/generated.rs | 76 |
2 files changed, 40 insertions, 38 deletions
diff --git a/crates/ra_assists/src/tests.rs b/crates/ra_assists/src/tests.rs index 97744904a..483e11931 100644 --- a/crates/ra_assists/src/tests.rs +++ b/crates/ra_assists/src/tests.rs | |||
@@ -1,3 +1,5 @@ | |||
1 | mod generated; | ||
2 | |||
1 | use std::sync::Arc; | 3 | use std::sync::Arc; |
2 | 4 | ||
3 | use hir::Semantics; | 5 | use hir::Semantics; |
diff --git a/crates/ra_assists/src/tests/generated.rs b/crates/ra_assists/src/tests/generated.rs index 6696cc832..7d35fa284 100644 --- a/crates/ra_assists/src/tests/generated.rs +++ b/crates/ra_assists/src/tests/generated.rs | |||
@@ -1,10 +1,10 @@ | |||
1 | //! Generated file, do not edit by hand, see `xtask/src/codegen` | 1 | //! Generated file, do not edit by hand, see `xtask/src/codegen` |
2 | 2 | ||
3 | use super::check; | 3 | use super::check_doc_test; |
4 | 4 | ||
5 | #[test] | 5 | #[test] |
6 | fn doctest_add_custom_impl() { | 6 | fn doctest_add_custom_impl() { |
7 | check( | 7 | check_doc_test( |
8 | "add_custom_impl", | 8 | "add_custom_impl", |
9 | r#####" | 9 | r#####" |
10 | #[derive(Deb<|>ug, Display)] | 10 | #[derive(Deb<|>ug, Display)] |
@@ -23,7 +23,7 @@ impl Debug for S { | |||
23 | 23 | ||
24 | #[test] | 24 | #[test] |
25 | fn doctest_add_derive() { | 25 | fn doctest_add_derive() { |
26 | check( | 26 | check_doc_test( |
27 | "add_derive", | 27 | "add_derive", |
28 | r#####" | 28 | r#####" |
29 | struct Point { | 29 | struct Point { |
@@ -43,7 +43,7 @@ struct Point { | |||
43 | 43 | ||
44 | #[test] | 44 | #[test] |
45 | fn doctest_add_explicit_type() { | 45 | fn doctest_add_explicit_type() { |
46 | check( | 46 | check_doc_test( |
47 | "add_explicit_type", | 47 | "add_explicit_type", |
48 | r#####" | 48 | r#####" |
49 | fn main() { | 49 | fn main() { |
@@ -60,7 +60,7 @@ fn main() { | |||
60 | 60 | ||
61 | #[test] | 61 | #[test] |
62 | fn doctest_add_function() { | 62 | fn doctest_add_function() { |
63 | check( | 63 | check_doc_test( |
64 | "add_function", | 64 | "add_function", |
65 | r#####" | 65 | r#####" |
66 | struct Baz; | 66 | struct Baz; |
@@ -87,7 +87,7 @@ fn bar(arg: &str, baz: Baz) { | |||
87 | 87 | ||
88 | #[test] | 88 | #[test] |
89 | fn doctest_add_hash() { | 89 | fn doctest_add_hash() { |
90 | check( | 90 | check_doc_test( |
91 | "add_hash", | 91 | "add_hash", |
92 | r#####" | 92 | r#####" |
93 | fn main() { | 93 | fn main() { |
@@ -104,7 +104,7 @@ fn main() { | |||
104 | 104 | ||
105 | #[test] | 105 | #[test] |
106 | fn doctest_add_impl() { | 106 | fn doctest_add_impl() { |
107 | check( | 107 | check_doc_test( |
108 | "add_impl", | 108 | "add_impl", |
109 | r#####" | 109 | r#####" |
110 | struct Ctx<T: Clone> { | 110 | struct Ctx<T: Clone> { |
@@ -125,7 +125,7 @@ impl<T: Clone> Ctx<T> { | |||
125 | 125 | ||
126 | #[test] | 126 | #[test] |
127 | fn doctest_add_impl_default_members() { | 127 | fn doctest_add_impl_default_members() { |
128 | check( | 128 | check_doc_test( |
129 | "add_impl_default_members", | 129 | "add_impl_default_members", |
130 | r#####" | 130 | r#####" |
131 | trait Trait { | 131 | trait Trait { |
@@ -159,7 +159,7 @@ impl Trait for () { | |||
159 | 159 | ||
160 | #[test] | 160 | #[test] |
161 | fn doctest_add_impl_missing_members() { | 161 | fn doctest_add_impl_missing_members() { |
162 | check( | 162 | check_doc_test( |
163 | "add_impl_missing_members", | 163 | "add_impl_missing_members", |
164 | r#####" | 164 | r#####" |
165 | trait Trait<T> { | 165 | trait Trait<T> { |
@@ -191,7 +191,7 @@ impl Trait<u32> for () { | |||
191 | 191 | ||
192 | #[test] | 192 | #[test] |
193 | fn doctest_add_new() { | 193 | fn doctest_add_new() { |
194 | check( | 194 | check_doc_test( |
195 | "add_new", | 195 | "add_new", |
196 | r#####" | 196 | r#####" |
197 | struct Ctx<T: Clone> { | 197 | struct Ctx<T: Clone> { |
@@ -213,7 +213,7 @@ impl<T: Clone> Ctx<T> { | |||
213 | 213 | ||
214 | #[test] | 214 | #[test] |
215 | fn doctest_apply_demorgan() { | 215 | fn doctest_apply_demorgan() { |
216 | check( | 216 | check_doc_test( |
217 | "apply_demorgan", | 217 | "apply_demorgan", |
218 | r#####" | 218 | r#####" |
219 | fn main() { | 219 | fn main() { |
@@ -230,7 +230,7 @@ fn main() { | |||
230 | 230 | ||
231 | #[test] | 231 | #[test] |
232 | fn doctest_auto_import() { | 232 | fn doctest_auto_import() { |
233 | check( | 233 | check_doc_test( |
234 | "auto_import", | 234 | "auto_import", |
235 | r#####" | 235 | r#####" |
236 | fn main() { | 236 | fn main() { |
@@ -251,7 +251,7 @@ pub mod std { pub mod collections { pub struct HashMap { } } } | |||
251 | 251 | ||
252 | #[test] | 252 | #[test] |
253 | fn doctest_change_visibility() { | 253 | fn doctest_change_visibility() { |
254 | check( | 254 | check_doc_test( |
255 | "change_visibility", | 255 | "change_visibility", |
256 | r#####" | 256 | r#####" |
257 | <|>fn frobnicate() {} | 257 | <|>fn frobnicate() {} |
@@ -264,7 +264,7 @@ pub(crate) fn frobnicate() {} | |||
264 | 264 | ||
265 | #[test] | 265 | #[test] |
266 | fn doctest_convert_to_guarded_return() { | 266 | fn doctest_convert_to_guarded_return() { |
267 | check( | 267 | check_doc_test( |
268 | "convert_to_guarded_return", | 268 | "convert_to_guarded_return", |
269 | r#####" | 269 | r#####" |
270 | fn main() { | 270 | fn main() { |
@@ -288,7 +288,7 @@ fn main() { | |||
288 | 288 | ||
289 | #[test] | 289 | #[test] |
290 | fn doctest_fill_match_arms() { | 290 | fn doctest_fill_match_arms() { |
291 | check( | 291 | check_doc_test( |
292 | "fill_match_arms", | 292 | "fill_match_arms", |
293 | r#####" | 293 | r#####" |
294 | enum Action { Move { distance: u32 }, Stop } | 294 | enum Action { Move { distance: u32 }, Stop } |
@@ -314,7 +314,7 @@ fn handle(action: Action) { | |||
314 | 314 | ||
315 | #[test] | 315 | #[test] |
316 | fn doctest_flip_binexpr() { | 316 | fn doctest_flip_binexpr() { |
317 | check( | 317 | check_doc_test( |
318 | "flip_binexpr", | 318 | "flip_binexpr", |
319 | r#####" | 319 | r#####" |
320 | fn main() { | 320 | fn main() { |
@@ -331,7 +331,7 @@ fn main() { | |||
331 | 331 | ||
332 | #[test] | 332 | #[test] |
333 | fn doctest_flip_comma() { | 333 | fn doctest_flip_comma() { |
334 | check( | 334 | check_doc_test( |
335 | "flip_comma", | 335 | "flip_comma", |
336 | r#####" | 336 | r#####" |
337 | fn main() { | 337 | fn main() { |
@@ -348,7 +348,7 @@ fn main() { | |||
348 | 348 | ||
349 | #[test] | 349 | #[test] |
350 | fn doctest_flip_trait_bound() { | 350 | fn doctest_flip_trait_bound() { |
351 | check( | 351 | check_doc_test( |
352 | "flip_trait_bound", | 352 | "flip_trait_bound", |
353 | r#####" | 353 | r#####" |
354 | fn foo<T: Clone +<|> Copy>() { } | 354 | fn foo<T: Clone +<|> Copy>() { } |
@@ -361,7 +361,7 @@ fn foo<T: Copy + Clone>() { } | |||
361 | 361 | ||
362 | #[test] | 362 | #[test] |
363 | fn doctest_inline_local_variable() { | 363 | fn doctest_inline_local_variable() { |
364 | check( | 364 | check_doc_test( |
365 | "inline_local_variable", | 365 | "inline_local_variable", |
366 | r#####" | 366 | r#####" |
367 | fn main() { | 367 | fn main() { |
@@ -379,7 +379,7 @@ fn main() { | |||
379 | 379 | ||
380 | #[test] | 380 | #[test] |
381 | fn doctest_introduce_variable() { | 381 | fn doctest_introduce_variable() { |
382 | check( | 382 | check_doc_test( |
383 | "introduce_variable", | 383 | "introduce_variable", |
384 | r#####" | 384 | r#####" |
385 | fn main() { | 385 | fn main() { |
@@ -397,7 +397,7 @@ fn main() { | |||
397 | 397 | ||
398 | #[test] | 398 | #[test] |
399 | fn doctest_invert_if() { | 399 | fn doctest_invert_if() { |
400 | check( | 400 | check_doc_test( |
401 | "invert_if", | 401 | "invert_if", |
402 | r#####" | 402 | r#####" |
403 | fn main() { | 403 | fn main() { |
@@ -414,7 +414,7 @@ fn main() { | |||
414 | 414 | ||
415 | #[test] | 415 | #[test] |
416 | fn doctest_make_raw_string() { | 416 | fn doctest_make_raw_string() { |
417 | check( | 417 | check_doc_test( |
418 | "make_raw_string", | 418 | "make_raw_string", |
419 | r#####" | 419 | r#####" |
420 | fn main() { | 420 | fn main() { |
@@ -431,7 +431,7 @@ fn main() { | |||
431 | 431 | ||
432 | #[test] | 432 | #[test] |
433 | fn doctest_make_usual_string() { | 433 | fn doctest_make_usual_string() { |
434 | check( | 434 | check_doc_test( |
435 | "make_usual_string", | 435 | "make_usual_string", |
436 | r#####" | 436 | r#####" |
437 | fn main() { | 437 | fn main() { |
@@ -448,7 +448,7 @@ fn main() { | |||
448 | 448 | ||
449 | #[test] | 449 | #[test] |
450 | fn doctest_merge_imports() { | 450 | fn doctest_merge_imports() { |
451 | check( | 451 | check_doc_test( |
452 | "merge_imports", | 452 | "merge_imports", |
453 | r#####" | 453 | r#####" |
454 | use std::<|>fmt::Formatter; | 454 | use std::<|>fmt::Formatter; |
@@ -462,7 +462,7 @@ use std::{fmt::Formatter, io}; | |||
462 | 462 | ||
463 | #[test] | 463 | #[test] |
464 | fn doctest_merge_match_arms() { | 464 | fn doctest_merge_match_arms() { |
465 | check( | 465 | check_doc_test( |
466 | "merge_match_arms", | 466 | "merge_match_arms", |
467 | r#####" | 467 | r#####" |
468 | enum Action { Move { distance: u32 }, Stop } | 468 | enum Action { Move { distance: u32 }, Stop } |
@@ -488,7 +488,7 @@ fn handle(action: Action) { | |||
488 | 488 | ||
489 | #[test] | 489 | #[test] |
490 | fn doctest_move_arm_cond_to_match_guard() { | 490 | fn doctest_move_arm_cond_to_match_guard() { |
491 | check( | 491 | check_doc_test( |
492 | "move_arm_cond_to_match_guard", | 492 | "move_arm_cond_to_match_guard", |
493 | r#####" | 493 | r#####" |
494 | enum Action { Move { distance: u32 }, Stop } | 494 | enum Action { Move { distance: u32 }, Stop } |
@@ -515,7 +515,7 @@ fn handle(action: Action) { | |||
515 | 515 | ||
516 | #[test] | 516 | #[test] |
517 | fn doctest_move_bounds_to_where_clause() { | 517 | fn doctest_move_bounds_to_where_clause() { |
518 | check( | 518 | check_doc_test( |
519 | "move_bounds_to_where_clause", | 519 | "move_bounds_to_where_clause", |
520 | r#####" | 520 | r#####" |
521 | fn apply<T, U, <|>F: FnOnce(T) -> U>(f: F, x: T) -> U { | 521 | fn apply<T, U, <|>F: FnOnce(T) -> U>(f: F, x: T) -> U { |
@@ -532,7 +532,7 @@ fn apply<T, U, F>(f: F, x: T) -> U where F: FnOnce(T) -> U { | |||
532 | 532 | ||
533 | #[test] | 533 | #[test] |
534 | fn doctest_move_guard_to_arm_body() { | 534 | fn doctest_move_guard_to_arm_body() { |
535 | check( | 535 | check_doc_test( |
536 | "move_guard_to_arm_body", | 536 | "move_guard_to_arm_body", |
537 | r#####" | 537 | r#####" |
538 | enum Action { Move { distance: u32 }, Stop } | 538 | enum Action { Move { distance: u32 }, Stop } |
@@ -559,7 +559,7 @@ fn handle(action: Action) { | |||
559 | 559 | ||
560 | #[test] | 560 | #[test] |
561 | fn doctest_remove_dbg() { | 561 | fn doctest_remove_dbg() { |
562 | check( | 562 | check_doc_test( |
563 | "remove_dbg", | 563 | "remove_dbg", |
564 | r#####" | 564 | r#####" |
565 | fn main() { | 565 | fn main() { |
@@ -576,7 +576,7 @@ fn main() { | |||
576 | 576 | ||
577 | #[test] | 577 | #[test] |
578 | fn doctest_remove_hash() { | 578 | fn doctest_remove_hash() { |
579 | check( | 579 | check_doc_test( |
580 | "remove_hash", | 580 | "remove_hash", |
581 | r#####" | 581 | r#####" |
582 | fn main() { | 582 | fn main() { |
@@ -593,7 +593,7 @@ fn main() { | |||
593 | 593 | ||
594 | #[test] | 594 | #[test] |
595 | fn doctest_remove_mut() { | 595 | fn doctest_remove_mut() { |
596 | check( | 596 | check_doc_test( |
597 | "remove_mut", | 597 | "remove_mut", |
598 | r#####" | 598 | r#####" |
599 | impl Walrus { | 599 | impl Walrus { |
@@ -610,7 +610,7 @@ impl Walrus { | |||
610 | 610 | ||
611 | #[test] | 611 | #[test] |
612 | fn doctest_reorder_fields() { | 612 | fn doctest_reorder_fields() { |
613 | check( | 613 | check_doc_test( |
614 | "reorder_fields", | 614 | "reorder_fields", |
615 | r#####" | 615 | r#####" |
616 | struct Foo {foo: i32, bar: i32}; | 616 | struct Foo {foo: i32, bar: i32}; |
@@ -625,7 +625,7 @@ const test: Foo = Foo {foo: 1, bar: 0} | |||
625 | 625 | ||
626 | #[test] | 626 | #[test] |
627 | fn doctest_replace_if_let_with_match() { | 627 | fn doctest_replace_if_let_with_match() { |
628 | check( | 628 | check_doc_test( |
629 | "replace_if_let_with_match", | 629 | "replace_if_let_with_match", |
630 | r#####" | 630 | r#####" |
631 | enum Action { Move { distance: u32 }, Stop } | 631 | enum Action { Move { distance: u32 }, Stop } |
@@ -653,7 +653,7 @@ fn handle(action: Action) { | |||
653 | 653 | ||
654 | #[test] | 654 | #[test] |
655 | fn doctest_replace_let_with_if_let() { | 655 | fn doctest_replace_let_with_if_let() { |
656 | check( | 656 | check_doc_test( |
657 | "replace_let_with_if_let", | 657 | "replace_let_with_if_let", |
658 | r#####" | 658 | r#####" |
659 | enum Option<T> { Some(T), None } | 659 | enum Option<T> { Some(T), None } |
@@ -679,7 +679,7 @@ fn compute() -> Option<i32> { None } | |||
679 | 679 | ||
680 | #[test] | 680 | #[test] |
681 | fn doctest_replace_qualified_name_with_use() { | 681 | fn doctest_replace_qualified_name_with_use() { |
682 | check( | 682 | check_doc_test( |
683 | "replace_qualified_name_with_use", | 683 | "replace_qualified_name_with_use", |
684 | r#####" | 684 | r#####" |
685 | fn process(map: std::collections::<|>HashMap<String, String>) {} | 685 | fn process(map: std::collections::<|>HashMap<String, String>) {} |
@@ -694,7 +694,7 @@ fn process(map: HashMap<String, String>) {} | |||
694 | 694 | ||
695 | #[test] | 695 | #[test] |
696 | fn doctest_replace_unwrap_with_match() { | 696 | fn doctest_replace_unwrap_with_match() { |
697 | check( | 697 | check_doc_test( |
698 | "replace_unwrap_with_match", | 698 | "replace_unwrap_with_match", |
699 | r#####" | 699 | r#####" |
700 | enum Result<T, E> { Ok(T), Err(E) } | 700 | enum Result<T, E> { Ok(T), Err(E) } |
@@ -718,7 +718,7 @@ fn main() { | |||
718 | 718 | ||
719 | #[test] | 719 | #[test] |
720 | fn doctest_split_import() { | 720 | fn doctest_split_import() { |
721 | check( | 721 | check_doc_test( |
722 | "split_import", | 722 | "split_import", |
723 | r#####" | 723 | r#####" |
724 | use std::<|>collections::HashMap; | 724 | use std::<|>collections::HashMap; |
@@ -731,7 +731,7 @@ use std::{collections::HashMap}; | |||
731 | 731 | ||
732 | #[test] | 732 | #[test] |
733 | fn doctest_unwrap_block() { | 733 | fn doctest_unwrap_block() { |
734 | check( | 734 | check_doc_test( |
735 | "unwrap_block", | 735 | "unwrap_block", |
736 | r#####" | 736 | r#####" |
737 | fn foo() { | 737 | fn foo() { |