ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/t/02_channel.t
Revision: 1.4
Committed: Sat Jul 21 18:21:45 2001 UTC (22 years, 10 months ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.3: +2 -2 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 1;
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 = $q->get;
21 print $x == $_-10 ? "ok " : "not ok ", ($_-10)*2+1, "\n";
22 }
23