mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-24 00:00:11 +02:00
23 lines
406 B
Rust
23 lines
406 B
Rust
#![feature(await_macro, async_await)]
|
|
|
|
use tokio::async_wait;
|
|
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);
|
|
async_wait!(Delay::new(when));
|
|
}
|