ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/t/03_keepalive.t
Revision: 1.2
Committed: Wed Apr 15 17:49:27 2009 UTC (15 years, 2 months ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.1: +15 -5 lines
Log Message:
keepalive fix

File Contents

# User Rev Content
1 root 1.2 BEGIN {
2     if (exists $ENV{AUTOMATED_TESTING}) {
3     print "1..0 # Skipped: Too many broken cpan tester setups.\n";
4     exit;
5     }
6     }
7    
8     BEGIN { $| = 1; print "1..8\n"; }
9 root 1.1
10     no warnings;
11     use strict;
12    
13     use EV;
14    
15 root 1.2 my $timer = EV::timer_ns 1, 0.3, sub { print "ok 7\n"; $_[0]->stop };
16 root 1.1
17     $timer->keepalive (1);
18    
19     print "ok 1\n";
20     EV::loop;
21     print "ok 2\n";
22    
23     $timer->start;
24    
25     $timer->keepalive (0);
26    
27     $timer->again;
28     $timer->stop;
29     $timer->start;
30    
31 root 1.2 my $timer2 = EV::timer 0, 0, sub { print "ok 4\n" };
32     $timer2->keepalive (0);
33    
34 root 1.1 print "ok 3\n";
35     EV::loop;
36 root 1.2 print "ok 5\n";
37 root 1.1
38     $timer->keepalive (1);
39    
40 root 1.2 print "ok 6\n";
41 root 1.1 EV::loop;
42 root 1.2 print "ok 8\n";
43 root 1.1