You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
async-std/tests/block_on.rs

17 lines
292 B
Rust

5 years ago
use async_std::task;
#[test]
fn smoke() {
let res = task::block_on(async { 1 + 2 });
assert_eq!(res, 3);
}
#[test]
5 years ago
#[should_panic = "boom"]
5 years ago
fn panic() {
task::block_on(async {
// This panic should get propagated into the parent thread.
5 years ago
panic!("boom");
5 years ago
});
}