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

22 lines
658 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() {
let (tx, rx) = channel::<&'static str>();
2013-03-04 22:33:51 -05:00
2014-01-27 18:29:50 -05:00
task::spawn(proc() {
assert_eq!(rx.recv(), "hello, world");
2014-01-27 18:29:50 -05:00
});
2013-03-04 22:33:51 -05:00
tx.send("hello, world");
2013-03-04 22:33:51 -05:00
}