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.3 by root, Sat Jul 14 22:14:21 2001 UTC vs.
Revision 1.10 by root, Wed Oct 3 16:03:17 2007 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines