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

Comparing EV/t/03_keepalive.t (file contents):
Revision 1.1 by root, Sat Nov 24 08:28:10 2007 UTC vs.
Revision 1.2 by root, Wed Apr 15 17:49:27 2009 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines