1 | $|=1; |
1 | $|=1; |
2 | print "1..13\n"; |
2 | print "1..18\n"; |
3 | |
3 | |
4 | use Coro; |
4 | use Coro; |
5 | use Coro::Cont; |
5 | use Coro::Cont; |
6 | |
6 | |
7 | $test = 1; |
7 | $test = 1; |
… | |
… | |
40 | |
40 | |
41 | $done = 0; |
41 | $done = 0; |
42 | |
42 | |
43 | yield while $done < 2; |
43 | yield while $done < 2; |
44 | |
44 | |
|
|
45 | sub cont : Cont { |
|
|
46 | result 2*shift; |
|
|
47 | result 3*shift; |
|
|
48 | } |
|
|
49 | |
|
|
50 | print cont(3) == 6 ? "ok " : "not ok ", $test++, "\n"; |
|
|
51 | print cont(4) == 12 ? "ok " : "not ok ", $test++, "\n"; |
|
|
52 | print cont(5) == 10 ? "ok " : "not ok ", $test++, "\n"; |
|
|
53 | print cont(6) == 18 ? "ok " : "not ok ", $test++, "\n"; |
|
|
54 | print cont(7) == 14 ? "ok " : "not ok ", $test++, "\n"; |
|
|
55 | |
|
|
56 | |
|
|
57 | |
|
|
58 | |