aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/doc_tests
diff options
context:
space:
mode:
authorUnreal Hoang <[email protected]>2020-03-26 09:16:10 +0000
committerUnreal Hoang <[email protected]>2020-03-26 15:08:12 +0000
commitd9df0f43ac669a68dc76466a2f2c21885b5af2dd (patch)
treec20d4c2a698b33c83014664754379b182b659dc9 /crates/ra_assists/src/doc_tests
parent785eb32f49653fbc5789396af4fa6ad61f89fb38 (diff)
Assist: replace unwrap with match
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",