blob: 96f7d3c9e40fff36a4cd9a4c8726e939418d81e6 [file] [log] [blame]
extern crate mio;
use mio::{Events, Poll, Token, Ready, PollOpt};
use mio::net::TcpListener;
use std::time::Duration;
#[test]
fn run_once_with_nothing() {
let mut events = Events::with_capacity(1024);
let poll = Poll::new().unwrap();
poll.poll(&mut events, Some(Duration::from_millis(100))).unwrap();
}
#[test]
fn add_then_drop() {
let mut events = Events::with_capacity(1024);
let l = TcpListener::bind(&"127.0.0.1:0".parse().unwrap()).unwrap();
let poll = Poll::new().unwrap();
poll.register(&l, Token(1), Ready::readable() | Ready::writable(), PollOpt::edge()).unwrap();
drop(l);
poll.poll(&mut events, Some(Duration::from_millis(100))).unwrap();
}