diff options
Diffstat (limited to 'third_party/rust/mio/test/test_smoke.rs')
-rw-r--r-- | third_party/rust/mio/test/test_smoke.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/third_party/rust/mio/test/test_smoke.rs b/third_party/rust/mio/test/test_smoke.rs new file mode 100644 index 0000000000..96f7d3c9e4 --- /dev/null +++ b/third_party/rust/mio/test/test_smoke.rs @@ -0,0 +1,23 @@ +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(); + +} |