ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/t/06_loop_once.t
Revision: 1.7
Committed: Thu Oct 28 04:59:36 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_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.6: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 BEGIN {
2 if (exists $ENV{AUTOMATED_TESTING}) {
3 print "1..0 # Skipped: Too many broken cpan tester setups.\n";
4 exit;
5 }
6 }
7 BEGIN { $| = 1; print "1..6\n"; }
8
9 no warnings;
10 use strict;
11 use Socket;
12
13 use EV;
14
15 my $l = new EV::Loop;
16
17 for my $i (3..5) {
18 $l->once (undef, 0, ($i - 3) * 0.1 + 0.2, sub {
19 print $_[0] == EV::TIMER ? "" : "not ", "ok $i\n";
20 });
21 }
22
23 socketpair my $s1, my $s2, AF_UNIX, SOCK_STREAM, PF_UNSPEC;
24
25 $l->once ($s1, EV::WRITE, 0.1, sub {
26 print $_[0] & EV::WRITE ? "" : "not ", "ok 2\n";
27 });
28
29 print "ok 1\n";
30 $l->run;
31 print "ok 6\n";