ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/t/08_async.t
Revision: 1.3
Committed: Tue Apr 15 04:41:57 2008 UTC (16 years, 2 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-3_51, rel-3_31, rel-3_33, rel-3_53, rel-3_52, rel-3_7, rel-3_6, rel-3_4, rel-3_3, rel-3_9, rel-3_8, rel-3_49, rel-3_44, rel-3_41, rel-3_42, rel-3_43, rel-3_48, rel-3_431
Changes since 1.2: +16 -14 lines
Log Message:
*** empty log message ***

File Contents

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