ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/t/00_basic.t
Revision: 1.7
Committed: Mon Dec 4 21:56:00 2006 UTC (17 years, 6 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-3_41, rel-3_55, rel-3_51, rel-3_6, rel-3_62, rel-3_63, rel-3_61, rel-3_4, rel-3_1, rel-3_5, rel-3_3, rel-3_2, rel-3_11, rel-3_501
Changes since 1.6: +21 -6 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     my $proc = new Coro::State \&a;
9     my $proc2 = 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.6 $proc->transfer ($main);
15 root 1.7 print $/ == 77 ? "" : "not ", "ok 5\n";
16 root 1.6 $proc->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     $proc2->transfer ($main);
24     print "not ok 8\n";
25     die;
26     }
27    
28     $proc2->save (0);
29    
30     $/ = 55;
31    
32 root 1.1 print "ok 2\n";
33 root 1.6 $main->transfer ($proc);
34 root 1.7 print $/ != 55 ? "not " : "ok 4\n";
35 root 1.6 $main->transfer ($proc);
36 root 1.7 print $/ != 55 ? "not " : "ok 6\n";
37     $main->transfer ($proc2);
38     print $/ != 55 ? "not " : "ok 8\n";
39 root 1.1