2019-08-08 12:44:48 +00:00
|
|
|
#![feature(async_await)]
|
|
|
|
|
|
|
|
use async_std::task;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn smoke() {
|
|
|
|
let res = task::block_on(async { 1 + 2 });
|
|
|
|
assert_eq!(res, 3);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2019-08-12 18:29:06 +00:00
|
|
|
#[should_panic = "boom"]
|
2019-08-08 12:44:48 +00:00
|
|
|
fn panic() {
|
|
|
|
task::block_on(async {
|
|
|
|
// This panic should get propagated into the parent thread.
|
2019-08-12 18:29:06 +00:00
|
|
|
panic!("boom");
|
2019-08-08 12:44:48 +00:00
|
|
|
});
|
|
|
|
}
|