summary refs log tree commit diff
path: root/src/test/run-pass/yield.rs
blob: 5578ca251ccb39e9db8242285fe53f87c574b693 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// -*- rust -*-
use std;
import task;
import task::*;

fn main() {
    let builder = task::builder();
    let result = task::future_result(builder);
    task::run(builder, || child() );
    #error("1");
    yield();
    #error("2");
    yield();
    #error("3");
    future::get(result);
}

fn child() {
    #error("4"); yield(); #error("5"); yield(); #error("6");
}