ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/t/08_async.t
Revision: 1.4
Committed: Thu Oct 21 15:13:43 2010 UTC (13 years, 8 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: EV-rel-4_28, EV-rel-4_29, EV-rel-4_26, EV-rel-4_27, EV-rel-4_25, EV-rel-4_22, EV-rel-4_20, EV-rel-4_21, rel-4_01, rel-4_00, rel-4_03, rel-4_02, EV-rel-4_31, EV-rel-4_30, EV-rel-4_33, EV-rel-4_32, EV-rel-4_34, EV_rel-4_11, EV_rel-4_10, EV-rel-4_15, EV_rel-4_17, EV_rel-4_16, EV-rel-4_18, HEAD
Changes since 1.3: +4 -4 lines
Log Message:
port testsuite

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::break;
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::run;
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->break;
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->run;
63 print "ok 13\n";
64 }
65