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, 8 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

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