mirror of
https://gitee.com/openharmony/third_party_rust_syn
synced 2024-11-27 09:50:41 +00:00
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:
parent
1a0cf9d3c2
commit
b7aaa083d6
@ -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,
|
||||
}),
|
||||
})
|
||||
"###);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user