diff options
Diffstat (limited to 'tests/test_expr.rs')
-rw-r--r-- | tests/test_expr.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_expr.rs b/tests/test_expr.rs index b2b65a25..8c1cc73a 100644 --- a/tests/test_expr.rs +++ b/tests/test_expr.rs @@ -300,3 +300,21 @@ fn test_macro_variable_match_arm() { } "###); } + +// https://github.com/dtolnay/syn/issues/1019 +#[test] +fn test_closure_vs_rangefull() { + #[rustfmt::skip] // rustfmt bug: https://github.com/rust-lang/rustfmt/issues/4808 + let tokens = quote!(|| .. .method()); + snapshot!(tokens as Expr, @r###" + Expr::MethodCall { + receiver: Expr::Closure { + output: Default, + body: Expr::Range { + limits: HalfOpen, + }, + }, + method: "method", + } + "###); +} |