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
This commit is contained in:
David Tolnay 2021-12-05 11:21:24 -08:00
parent 772d51f887
commit a9f14c18fa
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

9
src/test/pretty/async.rs Normal file
View File

@ -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
}