ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/t/03_cont.t
(Generate patch)

Comparing Coro/t/03_cont.t (file contents):
Revision 1.1 by root, Sat Jul 14 22:14:22 2001 UTC vs.
Revision 1.2 by root, Thu Jul 19 02:45:09 2001 UTC

5use Coro::Cont; 5use Coro::Cont;
6 6
7$test = 1; 7$test = 1;
8 8
9sub a1 : Coro { 9sub a1 : Coro {
10 my $cont = cont { 10 my $cont = csub {
11 { local $_; yield }; 11 { local $_; yield };
12 result $_*2; 12 result $_*2;
13 { local $_; yield }; 13 { local $_; yield };
14 result $_*3; 14 result $_*3;
15 }; 15 };
20 $done++; 20 $done++;
21 yield while 1; 21 yield while 1;
22} 22}
23 23
24sub a2 : Coro { 24sub a2 : Coro {
25 my $cont = cont { 25 my $cont = csub {
26 { local $_; yield }; 26 { local $_; yield };
27 result $_*20; 27 result $_*20;
28 { local $_; yield }; 28 { local $_; yield };
29 result $_*30; 29 result $_*30;
30 }; 30 };
39print "ok ", $test++, "\n"; 39print "ok ", $test++, "\n";
40 40
41$done = 0; 41$done = 0;
42 42
43yield while $done < 2; 43yield while $done < 2;
44

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines