Add test of let dot dot

Currently fails:

    ---- test_let_dot_dot stdout ----
    thread 'test_let_dot_dot' panicked at 'called `Result::unwrap()` on an `Err` value: Error("expected one of: literal, identifier, `::`, `<`, `self`, `Self`, `super`, `crate`, `const`")', tests/test_stmt.rs:85:5
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
This commit is contained in:
David Tolnay 2022-03-13 23:10:59 -07:00
parent 1a0cf9d3c2
commit b7aaa083d6
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -4,6 +4,7 @@
mod macros;
use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream, TokenTree};
use quote::quote;
use std::iter::FromIterator;
use syn::Stmt;
@ -74,3 +75,19 @@ fn test_none_group() {
})
"###);
}
#[test]
fn test_let_dot_dot() {
let tokens = quote! {
let .. = 10;
};
snapshot!(tokens as Stmt, @r###"
Local(Local {
pat: Pat::Rest,
init: Some(Expr::Lit {
lit: 10,
}),
})
"###);
}