mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
24 lines
399 B
Rust
24 lines
399 B
Rust
extern crate futures;
|
|||
|
|
extern crate loom;
|
||
|
|
|
||
|
|
#[path = "../src/oneshot.rs"]
|
||
|
|
#[allow(warnings)]
|
||
|
|
mod oneshot;
|
||
|
|
|
||
|
|
use loom::thread;
|
||
|
|
use loom::futures::block_on;
|
||
|
|
|
||
|
|
#[test]
|
||
|
|
fn smoke() {
|
||
|
|
loom::fuzz(|| {
|
||
|
|
let (tx, rx) = oneshot::channel();
|
||
|
|
|
||
|
|
thread::spawn(move || {
|
||
|
|
tx.send(1).unwrap();
|
||
|
|
});
|
||
|
|
|
||
|
|
let value = block_on(rx).unwrap();
|
||
|
|
assert_eq!(1, value);
|
||
|
|
});
|
||
|
|
}
|