Skip to content

Commit 59c13c6

Browse files
dtolnaytaiki-e
authored andcommitted
Add test of select's grammar
1 parent aafe554 commit 59c13c6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

futures/tests/async_await_macros.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ fn select() {
5757
assert!(ran);
5858
}
5959

60+
#[test]
61+
fn select_grammar() {
62+
// Parsing after `=>` using Expr::parse would parse `{}() = future::ready(())`
63+
// as one expression.
64+
block_on(async {
65+
select! {
66+
() = future::pending::<()>() => {}
67+
() = future::ready(()) => {}
68+
}
69+
});
70+
}
71+
6072
#[test]
6173
fn select_biased() {
6274
let (tx1, rx1) = oneshot::channel::<i32>();

0 commit comments

Comments
 (0)