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

# 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 $proc = new Coro::State \&a;
9 my $proc2 = new Coro::State \&b;
10
11 sub a {
12 $/ = 77;
13 print "ok 3\n";
14 $proc->transfer ($main);
15 print $/ == 77 ? "" : "not ", "ok 5\n";
16 $proc->transfer ($main);
17 print "not ok 6\n";
18 die;
19 }
20
21 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 print "ok 2\n";
33 $main->transfer ($proc);
34 print $/ != 55 ? "not " : "ok 4\n";
35 $main->transfer ($proc);
36 print $/ != 55 ? "not " : "ok 6\n";
37 $main->transfer ($proc2);
38 print $/ != 55 ? "not " : "ok 8\n";
39