ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/t/02_channel.t
Revision: 1.3
Committed: Sat Jul 14 22:14:21 2001 UTC (23 years ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.2: +0 -1 lines
Log Message:
*** empty log message ***

File Contents

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