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

Comparing Coro/t/02_channel.t (file contents):
Revision 1.1 by root, Tue Jul 10 01:43:21 2001 UTC vs.
Revision 1.3 by root, Sat Jul 14 22:14:21 2001 UTC

1$|=1; 1$|=1;
2print "1..19\n"; 2print "1..19\n";
3 3
4use Coro; 4use Coro;
5use Coro::Process;
6use Coro::Channel; 5use Coro::Channel;
7 6
8my $q = new Coro::Channel 0; 7my $q = new Coro::Channel 0;
9 8
10sub producer : Coro { 9sub producer : Coro {
16 15
17print "ok 1\n"; 16print "ok 1\n";
18yield; 17yield;
19 18
20for (11..19) { 19for (11..19) {
21 my $x = $q->get; 20 my $x = do { local $_; $q->get };
22 print $x == $_-10 ? "ok " : "not ok ", ($_-10)*2+1, "\n"; 21 print $x == $_-10 ? "ok " : "not ok ", ($_-10)*2+1, "\n";
23} 22}
24 23

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines