ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/t/08_async.t
(Generate patch)

Comparing EV/t/08_async.t (file contents):
Revision 1.2 by root, Sat Feb 9 23:05:18 2008 UTC vs.
Revision 1.3 by root, Tue Apr 15 04:41:57 2008 UTC

1BEGIN { $| = 1; print "1..12\n"; } 1BEGIN { $| = 1; print "1..13\n"; }
2 2
3no warnings; 3no warnings;
4use strict; 4use strict;
5 5
6use EV; 6use EV;
10 10
11 $a3 = EV::async sub { 11 $a3 = EV::async sub {
12 print "not ok 1\n"; 12 print "not ok 1\n";
13 }; 13 };
14 $a2 = EV::async sub { 14 $a2 = EV::async sub {
15 print "ok 4\n"; 15 print "ok 5\n";
16 $a1->cb (sub { 16 $a1->cb (sub {
17 print "ok 5\n"; 17 print "ok 6\n";
18 EV::unloop; 18 EV::unloop;
19 }); 19 });
20 $a1->send; 20 $a1->send;
21 }; 21 };
22 $a1 = EV::async sub { 22 $a1 = EV::async sub {
23 print "ok 3\n"; 23 print $a1->async_pending ? "not " : "", "ok 4\n";
24 $a2->send; 24 $a2->send;
25 }; 25 };
26 26
27 print "ok 1\n"; 27 print $a1->async_pending ? "not " : "", "ok 1\n";
28 $a1->send;
29 print $a1->async_pending ? "" : "not ", "ok 2\n";
28 $a1->send; 30 $a1->send;
29 $a1->send; 31 $a1->send;
30 $a1->send;
31 print "ok 2\n"; 32 print "ok 3\n";
32 EV::loop; 33 EV::loop;
33 print "ok 6\n"; 34 print "ok 7\n";
34} 35}
35 36
36{ 37{
37 my $l = new EV::Loop; 38 my $l = new EV::Loop;
38 my ($a1, $a2, $a3); 39 my ($a1, $a2, $a3);
39 40
40 $a3 = $l->async (sub { 41 $a3 = $l->async (sub {
41 print "not ok 7\n"; 42 print "not ok 8\n";
42 }); 43 });
43 $a2 = $l->async (sub { 44 $a2 = $l->async (sub {
44 print "ok 10\n"; 45 print "ok 11\n";
45 $a1->cb (sub { 46 $a1->cb (sub {
46 print "ok 11\n"; 47 print "ok 12\n";
47 $l->unloop; 48 $l->unloop;
48 }); 49 });
49 $a1->send; 50 $a1->send;
50 }); 51 });
51 $a1 = $l->async (sub { 52 $a1 = $l->async (sub {
52 print "ok 9\n"; 53 print "ok 10\n";
53 $a2->send; 54 $a2->send;
54 }); 55 });
55 56
56 print "ok 7\n"; 57 print "ok 8\n";
57 $a1->send; 58 $a1->send;
58 $a1->send; 59 $a1->send;
59 $a1->send; 60 $a1->send;
60 print "ok 8\n"; 61 print "ok 9\n";
61 $l->loop; 62 $l->loop;
62 print "ok 12\n"; 63 print "ok 13\n";
63} 64}
65

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines