From 9968ccfc303f6cc6fed614118400faabcb9a6760 Mon Sep 17 00:00:00 2001 From: Dan Luu Date: Sun, 28 Apr 2013 14:50:04 -0400 Subject: [PATCH] Update old xfailing spawn/bind/join test --- src/test/run-pass/clone-with-exterior.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/test/run-pass/clone-with-exterior.rs b/src/test/run-pass/clone-with-exterior.rs index f0734e285b2..57c4f91142d 100644 --- a/src/test/run-pass/clone-with-exterior.rs +++ b/src/test/run-pass/clone-with-exterior.rs @@ -8,17 +8,21 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//xfail-test - extern mod std; +use core::task::spawn; -fn f(x : @{a:int, b:int}) { - assert!((x.a == 10)); - assert!((x.b == 12)); +struct Pair { + a: int, + b: int } pub fn main() { - let z : @{a:int, b:int} = @{ a : 10, b : 12}; - let p = task::_spawn(bind f(z)); - task::join_id(p); + let z = ~Pair { a : 10, b : 12}; + + let f: ~fn() = || { + assert!((z.a == 10)); + assert!((z.b == 12)); + }; + + spawn(f); }