aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/tests')
-rw-r--r--crates/ra_assists/src/tests/generated.rs29
1 files changed, 26 insertions, 3 deletions
diff --git a/crates/ra_assists/src/tests/generated.rs b/crates/ra_assists/src/tests/generated.rs
index 3808aded1..3e6654c17 100644
--- a/crates/ra_assists/src/tests/generated.rs
+++ b/crates/ra_assists/src/tests/generated.rs
@@ -204,7 +204,7 @@ struct Ctx<T: Clone> {
204} 204}
205 205
206impl<T: Clone> Ctx<T> { 206impl<T: Clone> Ctx<T> {
207 fn new(data: T) -> Self { Self { data } } 207 fn $0new(data: T) -> Self { Self { data } }
208} 208}
209 209
210"#####, 210"#####,
@@ -276,7 +276,7 @@ fn doctest_change_return_type_to_result() {
276fn foo() -> i32<|> { 42i32 } 276fn foo() -> i32<|> { 42i32 }
277"#####, 277"#####,
278 r#####" 278 r#####"
279fn foo() -> Result<i32, > { Ok(42i32) } 279fn foo() -> Result<i32, ${0:_}> { Ok(42i32) }
280"#####, 280"#####,
281 ) 281 )
282} 282}
@@ -336,7 +336,7 @@ enum Action { Move { distance: u32 }, Stop }
336 336
337fn handle(action: Action) { 337fn handle(action: Action) {
338 match action { 338 match action {
339 Action::Move { distance } => {} 339 $0Action::Move { distance } => {}
340 Action::Stop => {} 340 Action::Stop => {}
341 } 341 }
342} 342}
@@ -345,6 +345,29 @@ fn handle(action: Action) {
345} 345}
346 346
347#[test] 347#[test]
348fn doctest_fix_visibility() {
349 check_doc_test(
350 "fix_visibility",
351 r#####"
352mod m {
353 fn frobnicate() {}
354}
355fn main() {
356 m::frobnicate<|>() {}
357}
358"#####,
359 r#####"
360mod m {
361 $0pub(crate) fn frobnicate() {}
362}
363fn main() {
364 m::frobnicate() {}
365}
366"#####,
367 )
368}
369
370#[test]
348fn doctest_flip_binexpr() { 371fn doctest_flip_binexpr() {
349 check_doc_test( 372 check_doc_test(
350 "flip_binexpr", 373 "flip_binexpr",