rust/src/test/run-pass/issue-4448.rs

22 lines
668 B
Rust
Raw Normal View History

2013-03-04 22:33:51 -05:00
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::task;
2013-03-27 09:58:28 -07:00
pub fn main() {
2013-12-05 18:19:06 -08:00
let (port, chan) = Chan::<&'static str>::new();
2013-03-04 22:33:51 -05:00
2014-01-27 18:29:50 -05:00
task::spawn(proc() {
assert_eq!(port.recv(), "hello, world");
2014-01-27 18:29:50 -05:00
});
2013-03-04 22:33:51 -05:00
chan.send("hello, world");
}