From e505752442f849c7d37465f0e0b6aa042644787b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Carlos=20Mour=C3=A3o=20Paes=20de=20Carvalho?= Date: Fri, 12 Mar 2021 08:53:57 -0300 Subject: fix: generated test fixture --- crates/ide_assists/src/tests/generated.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'crates/ide_assists/src/tests/generated.rs') diff --git a/crates/ide_assists/src/tests/generated.rs b/crates/ide_assists/src/tests/generated.rs index 304b5798f..af513ca22 100644 --- a/crates/ide_assists/src/tests/generated.rs +++ b/crates/ide_assists/src/tests/generated.rs @@ -205,6 +205,29 @@ const _: i32 = 0b1010; ) } +#[test] +fn doctest_convert_iter_for_each_to_for() { + check_doc_test( + "convert_iter_for_each_to_for", + r#####" +fn main() { + let vec = vec![(1, 2), (2, 3), (3, 4)]; + x.iter().for_each(|(x, y)| { + println!("x: {}, y: {}", x, y); + }); +} +"#####, + r#####" +fn main() { + let vec = vec![(1, 2), (2, 3), (3, 4)]; + for (x, y) in x.iter() { + println!("x: {}, y: {}", x, y); + } +} +"#####, + ) +} + #[test] fn doctest_convert_to_guarded_return() { check_doc_test( -- cgit v1.2.3