From a9f14c18fa1fe455aa9ea3efb74335653d51a884 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 5 Dec 2021 11:21:24 -0800 Subject: [PATCH] Add pretty printer test for async blocks Currently fails with: ---- [pretty] pretty/async.rs stdout ---- error: pretty-printed source does not match expected source expected: ------------------------------------------ // pp-exact // pretty-compare-only // edition:2021 async fn f() { let first = async { 1 }; let second = async move { 2 }; join(first, second).await } ------------------------------------------ actual: ------------------------------------------ // pp-exact // pretty-compare-only // edition:2021 async fn f() { let first = async { 1 }; let second = async move { 2 }; join(first, second).await } ------------------------------------------ diff: ------------------------------------------ 3 // edition:2021 4 5 async fn f() { - let first = async { 1 }; - let second = async move { 2 }; + let first = async { 1 }; + let second = async move { 2 }; 8 join(first, second).await 9 } 10 --- src/test/pretty/async.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/test/pretty/async.rs diff --git a/src/test/pretty/async.rs b/src/test/pretty/async.rs new file mode 100644 index 00000000000..573e79bffd7 --- /dev/null +++ b/src/test/pretty/async.rs @@ -0,0 +1,9 @@ +// pp-exact +// pretty-compare-only +// edition:2021 + +async fn f() { + let first = async { 1 }; + let second = async move { 2 }; + join(first, second).await +}