2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-16 10:49:55 +00:00
async-std/tests/block_on.rs
2020-05-02 20:27:50 +02:00

18 lines
329 B
Rust

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