2011-06-28 17:54:16 -05:00
|
|
|
// xfail-stage1
|
|
|
|
// xfail-stage2
|
2011-07-20 21:37:09 -05:00
|
|
|
// xfail-stage3
|
2011-06-28 17:54:16 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
A test case for issue #577, which also exposes #588
|
|
|
|
*/
|
|
|
|
|
|
|
|
use std;
|
|
|
|
import std::task::join;
|
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn child() { }
|
2011-06-28 17:54:16 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// tasks
|
2011-07-27 07:19:39 -05:00
|
|
|
let t1;
|
|
|
|
let t2;
|
2011-06-28 17:54:16 -05:00
|
|
|
|
|
|
|
t1 = spawn child();
|
|
|
|
t2 = spawn child();
|
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
assert (t1 == t1);
|
|
|
|
assert (t1 != t2);
|
2011-06-28 17:54:16 -05:00
|
|
|
|
|
|
|
// ports
|
2011-07-27 07:19:39 -05:00
|
|
|
let p1;
|
|
|
|
let p2;
|
2011-07-13 17:44:09 -05:00
|
|
|
|
2011-06-28 17:54:16 -05:00
|
|
|
p1 = port[int]();
|
|
|
|
p2 = port[int]();
|
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
assert (p1 == p1);
|
|
|
|
assert (p1 != p2);
|
2011-07-13 17:44:09 -05:00
|
|
|
|
2011-06-28 17:54:16 -05:00
|
|
|
// channels
|
2011-07-27 07:19:39 -05:00
|
|
|
let c1;
|
|
|
|
let c2;
|
2011-07-13 17:44:09 -05:00
|
|
|
|
2011-06-28 17:54:16 -05:00
|
|
|
c1 = chan(p1);
|
|
|
|
c2 = chan(p2);
|
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
assert (c1 == c1);
|
|
|
|
assert (c1 != c2);
|
2011-06-28 17:54:16 -05:00
|
|
|
|
|
|
|
join(t1);
|
|
|
|
join(t2);
|
2011-07-27 07:19:39 -05:00
|
|
|
}
|