ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/t/02_channel.t
Revision: 1.1
Committed: Tue Jul 10 01:43:21 2001 UTC (23 years ago) by root
Content type: application/x-troff
Branch: MAIN
Log Message:
*** empty log message ***

File Contents

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