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

# User Rev Content
1 root 1.1 $|=1;
2     print "1..19\n";
3    
4     use Coro;
5     use Coro::Channel;
6    
7 root 1.4 my $q = new Coro::Channel 1;
8 root 1.1
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 root 1.4 my $x = $q->get;
21 root 1.1 print $x == $_-10 ? "ok " : "not ok ", ($_-10)*2+1, "\n";
22     }
23