mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-21 00:00:10 +02:00
This function is used by the Tokio macros introduced by #1058 but was omitted from the PR.
23 lines
396 B
Rust
23 lines
396 B
Rust
#![feature(await_macro, async_await)]
|
|
|
|
use tokio::await;
|
|
use tokio::timer::Delay;
|
|
use std::time::{Duration, Instant};
|
|
|
|
#[tokio::test]
|
|
async fn success_no_async() {
|
|
assert!(true);
|
|
}
|
|
|
|
#[tokio::test]
|
|
#[should_panic]
|
|
async fn fail_no_async() {
|
|
assert!(false);
|
|
}
|
|
|
|
#[tokio::test]
|
|
async fn use_timer() {
|
|
let when = Instant::now() + Duration::from_millis(10);
|
|
await!(Delay::new(when));
|
|
}
|