]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/spawn-types.rs
fe6ea6374b13b81726fc456628b3cee5ac0deb0c
[rust.git] / src / test / run-pass / spawn-types.rs
1 /*
2   Make sure we can spawn tasks that take different types of
3   parameters. This is based on a test case for #520 provided by Rob
4   Arnold.
5  */
6
7 use std;
8
9 import str;
10 import comm;
11 import task;
12
13 type ctx = comm::chan<int>;
14
15 fn iotask(&&args: (ctx, str)) {
16     let (cx, ip) = args;
17     assert (str::eq(ip, "localhost"));
18 }
19
20 fn main() {
21     let p = comm::port::<int>();
22     task::spawn((comm::chan(p), "localhost"), iotask);
23 }