Fix async assertion in test_sendable_future

This commit is contained in:
Kevin Walter 2014-10-01 16:09:38 +02:00
parent 8ab6fce95e
commit 3dc32a1ded

View file

@ -201,12 +201,13 @@ mod test {
#[test]
fn test_sendable_future() {
let expected = "schlorf";
let (tx, rx) = channel();
let f = Future::spawn(proc() { expected });
task::spawn(proc() {
let mut f = f;
let actual = f.get();
assert_eq!(actual, expected);
tx.send(f.get());
});
assert_eq!(rx.recv(), expected);
}
#[test]