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

Comparing EV/t/02_once.t (file contents):
Revision 1.6 by root, Sat Mar 22 23:55:22 2008 UTC vs.
Revision 1.9 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..6\n"; } 8BEGIN { $| = 1; print "1..6\n"; }
2 9
3no warnings; 10no warnings;
4use strict; 11use strict;
5use Socket; 12use Socket;
6 13
7use EV; 14use EV;
8 15
9for my $i (3..5) { 16for my $i (3..5) {
10 EV::once undef, 0, $i * 0.4, sub { 17 EV::once undef, 0, ($i - 3) * 0.3 + 0.6, sub {
11 print $_[0] == EV::TIMEOUT ? "" : "not ", "ok $i\n"; 18 print $_[0] == EV::TIMEOUT ? "" : "not ", "ok $i\n";
12 }; 19 };
13} 20}
14 21
15socketpair my $s1, my $s2, AF_UNIX, SOCK_STREAM, PF_UNSPEC; 22socketpair my $s1, my $s2, AF_UNIX, SOCK_STREAM, PF_UNSPEC;
16 23
17EV::once $s1, EV::WRITE, 0.8, sub { 24EV::once $s1, EV::WRITE, 0.3, sub {
18 print $_[0] & EV::WRITE ? "" : "not ", "ok 2\n"; 25 print $_[0] & EV::WRITE ? "" : "not ", "ok 2\n";
19}; 26};
20 27
21print "ok 1\n"; 28print "ok 1\n";
22EV::loop; 29EV::loop;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines