2012-09-19 13:59:44 -07:00
|
|
|
// xfail-fast
|
2012-09-18 15:52:21 -07:00
|
|
|
#[legacy_modes];
|
|
|
|
|
2012-09-11 17:46:20 -07:00
|
|
|
extern mod std;
|
2011-08-05 18:43:33 -07:00
|
|
|
|
2012-09-05 12:32:05 -07:00
|
|
|
use pipes::Chan;
|
|
|
|
use pipes::Port;
|
2011-08-05 18:43:33 -07:00
|
|
|
|
2011-07-27 14:19:39 +02:00
|
|
|
fn main() { test05(); }
|
2010-07-19 14:05:18 -07:00
|
|
|
|
2012-08-28 11:11:15 -07:00
|
|
|
fn test05_start(ch : Chan<int>) {
|
2012-07-25 14:05:06 -07:00
|
|
|
ch.send(10);
|
2012-08-22 17:24:52 -07:00
|
|
|
error!("sent 10");
|
2012-07-25 14:05:06 -07:00
|
|
|
ch.send(20);
|
2012-08-22 17:24:52 -07:00
|
|
|
error!("sent 20");
|
2012-07-25 14:05:06 -07:00
|
|
|
ch.send(30);
|
2012-08-22 17:24:52 -07:00
|
|
|
error!("sent 30");
|
2011-08-05 18:43:33 -07:00
|
|
|
}
|
2010-07-19 14:05:18 -07:00
|
|
|
|
2011-04-19 13:35:49 -07:00
|
|
|
fn test05() {
|
2012-07-25 14:05:06 -07:00
|
|
|
let (ch, po) = pipes::stream();
|
2012-09-18 22:45:24 -07:00
|
|
|
task::spawn(|move ch| test05_start(ch) );
|
2012-07-25 14:05:06 -07:00
|
|
|
let mut value = po.recv();
|
2011-12-22 17:53:53 -08:00
|
|
|
log(error, value);
|
2012-07-25 14:05:06 -07:00
|
|
|
value = po.recv();
|
2011-12-22 17:53:53 -08:00
|
|
|
log(error, value);
|
2012-07-25 14:05:06 -07:00
|
|
|
value = po.recv();
|
2011-12-22 17:53:53 -08:00
|
|
|
log(error, value);
|
2011-05-02 17:47:24 -07:00
|
|
|
assert (value == 30);
|
2011-08-06 10:07:39 -07:00
|
|
|
}
|