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

Comparing Coro/t/00_basic.t (file contents):
Revision 1.8 by root, Wed Oct 3 01:48:06 2007 UTC vs.
Revision 1.9 by root, Wed Oct 3 10:29:41 2007 UTC

3use Coro::State; 3use Coro::State;
4$loaded = 1; 4$loaded = 1;
5print "ok 1\n"; 5print "ok 1\n";
6 6
7my $main = new Coro::State; 7my $main = new Coro::State;
8my $proc = new Coro::State \&a; 8my $proca = new Coro::State \&a;
9my $proc2 = new Coro::State \&b; 9my $procb = new Coro::State \&b;
10 10
11sub a { 11sub a {
12 $/ = 77; 12 $/ = 77;
13 print "ok 3\n"; 13 print "ok 3\n";
14 $proc->transfer ($main); 14 $proca->transfer ($main);
15 print $/ == 77 ? "" : "not ", "ok 5\n"; 15 print $/ == 77 ? "" : "not ", "ok 5\n";
16 $proc->transfer ($main); 16 $proca->transfer ($main);
17 print "not ok 6\n"; 17 print "not ok 6\n";
18 die; 18 die;
19} 19}
20 20
21sub b { 21sub b {
22 print $/ != 55 ? "not " : "", "ok 7\n"; 22 print $/ != 55 ? "not " : "", "ok 7\n";
23 $proc2->transfer ($main); 23 $procb->transfer ($main);
24 print "not ok 8\n"; 24 print "not ok 8\n";
25 die; 25 die;
26} 26}
27 27
28$/ = 55; 28$/ = 55;
29 29
30print "ok 2\n"; 30print "ok 2\n";
31$main->transfer ($proc); 31$main->transfer ($proca);
32print $/ != 55 ? "not " : "ok 4\n"; 32print $/ != 55 ? "not " : "ok 4\n";
33$main->transfer ($proc); 33$main->transfer ($proca);
34print $/ != 55 ? "not " : "ok 6\n"; 34print $/ != 55 ? "not " : "ok 6\n";
35$main->transfer ($proc2); 35$main->transfer ($procb);
36print $/ != 55 ? "not " : "ok 8\n"; 36print $/ != 55 ? "not " : "ok 8\n";
37 37

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines