ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/t/00_basic.t
Revision: 1.8
Committed: Wed Oct 3 01:48:06 2007 UTC (16 years, 8 months ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.7: +0 -2 lines
Log Message:
temporary check-in, non-working version

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 $/ = 55;
29
30 print "ok 2\n";
31 $main->transfer ($proc);
32 print $/ != 55 ? "not " : "ok 4\n";
33 $main->transfer ($proc);
34 print $/ != 55 ? "not " : "ok 6\n";
35 $main->transfer ($proc2);
36 print $/ != 55 ? "not " : "ok 8\n";
37