Skip to content

Commit

Permalink
Add test of select's grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay authored and taiki-e committed Mar 3, 2024
1 parent aafe554 commit 59c13c6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions futures/tests/async_await_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ fn select() {
assert!(ran);
}

#[test]
fn select_grammar() {
// Parsing after `=>` using Expr::parse would parse `{}() = future::ready(())`
// as one expression.
block_on(async {
select! {
() = future::pending::<()>() => {}
() = future::ready(()) => {}
}
});
}

#[test]
fn select_biased() {
let (tx1, rx1) = oneshot::channel::<i32>();
Expand Down

0 comments on commit 59c13c6

Please sign in to comment.