Skip to content

Commit

Permalink
Add test where None-delimited group makes precedence go wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 11, 2023
1 parent c7ccf6d commit 93d52b0
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/test_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,4 +399,43 @@ fn test_extended_interpolated_path() {
},
}
"###);

// FIXME
let nested = Group::new(Delimiter::None, quote!(a::b || true));
let tokens = quote!(if #nested && false {});
snapshot!(tokens as Expr, @r###"
Expr::If {
cond: Expr::Binary {
left: Expr::Path {
path: Path {
segments: [
PathSegment {
ident: "a",
},
PathSegment {
ident: "b",
},
],
},
},
op: BinOp::Or,
right: Expr::Binary {
left: Expr::Lit {
lit: Lit::Bool {
value: true,
},
},
op: BinOp::And,
right: Expr::Lit {
lit: Lit::Bool {
value: false,
},
},
},
},
then_branch: Block {
stmts: [],
},
}
"###);
}

0 comments on commit 93d52b0

Please sign in to comment.