ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/t/00_basic.t
Revision: 1.9
Committed: Wed Oct 3 10:29:41 2007 UTC (16 years, 9 months ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.8: +8 -8 lines
Log Message:
*** empty log message ***

File Contents

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