async-std/tests/block_on.rs
Stjepan Glavina 1f9628d8ad Cleanup
2019-08-12 20:29:16 +02:00

18 lines
318 B
Rust

#![feature(async_await)]
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");
});
}