aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/doc_tests
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-26 15:38:03 +0000
committerGitHub <[email protected]>2020-03-26 15:38:03 +0000
commit20c110e57f24aa54154942ee40921e9129fbc595 (patch)
treea235a1338f590a243c3fd1302ac2e32ec4d24f05 /crates/ra_assists/src/doc_tests
parent0a8e65cf850ec3642fa51a3b71a4a7564c46a89b (diff)
parentd9df0f43ac669a68dc76466a2f2c21885b5af2dd (diff)
Merge #3732
3732: Assist: replace unwrap with match r=matklad a=unrealhoang attempt on #3669 Co-authored-by: Unreal Hoang <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/doc_tests')
-rw-r--r--crates/ra_assists/src/doc_tests/generated.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/ra_assists/src/doc_tests/generated.rs b/crates/ra_assists/src/doc_tests/generated.rs
index 62dcb3808..543224232 100644
--- a/crates/ra_assists/src/doc_tests/generated.rs
+++ b/crates/ra_assists/src/doc_tests/generated.rs
@@ -623,6 +623,30 @@ fn process(map: HashMap<String, String>) {}
623} 623}
624 624
625#[test] 625#[test]
626fn doctest_replace_unwrap_with_match() {
627 check(
628 "replace_unwrap_with_match",
629 r#####"
630enum Result<T, E> { Ok(T), Err(E) }
631fn main() {
632 let x: Result<i32, i32> = Result::Ok(92);
633 let y = x.<|>unwrap();
634}
635"#####,
636 r#####"
637enum Result<T, E> { Ok(T), Err(E) }
638fn main() {
639 let x: Result<i32, i32> = Result::Ok(92);
640 let y = match x {
641 Ok(a) => a,
642 _ => unreachable!(),
643 };
644}
645"#####,
646 )
647}
648
649#[test]
626fn doctest_split_import() { 650fn doctest_split_import() {
627 check( 651 check(
628 "split_import", 652 "split_import",