/src/test/run-pass/spawn-types.rs
http://github.com/jruderman/rust · Rust · 23 lines · 13 code · 5 blank · 5 comment · 1 complexity · 793f9bfdb4c6a07c8af1b93b074283dc MD5 · raw file
- /*
- Make sure we can spawn tasks that take different types of
- parameters. This is based on a test case for #520 provided by Rob
- Arnold.
- */
- use std;
- import str;
- import comm;
- import task;
- type ctx = comm::chan<int>;
- fn iotask(cx: ctx, ip: ~str) {
- assert (ip == ~"localhost");
- }
- fn main() {
- let p = comm::port::<int>();
- let ch = comm::chan(p);
- task::spawn(|| iotask(ch, ~"localhost") );
- }