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.2 by root, Fri Nov 23 13:08:57 2007 UTC vs.
Revision 1.8 by root, Fri Nov 21 02:23:15 2008 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;
12use Socket;
5 13
6use EV; 14use EV;
7 15
8for my $i (3..5) { 16for my $i (3..5) {
9 EV::once undef, 0, $i * 0.05, sub { 17 EV::once undef, 0, ($i - 3) * 0.5 + 1.0, sub {
10 print $_[0] == EV::TIMEOUT ? "" : "not ", "ok $i\n"; 18 print $_[0] == EV::TIMEOUT ? "" : "not ", "ok $i\n";
11 }; 19 };
12} 20}
13 21
22socketpair my $s1, my $s2, AF_UNIX, SOCK_STREAM, PF_UNSPEC;
23
14EV::once 1, EV::WRITE, 0.5, sub { 24EV::once $s1, EV::WRITE, 0.5, sub {
15 print $_[0] == EV::WRITE ? "" : "not ", "ok 2\n"; 25 print $_[0] & EV::WRITE ? "" : "not ", "ok 2\n";
16}; 26};
17 27
18print "ok 1\n"; 28print "ok 1\n";
19EV::loop; 29EV::loop;
20print "ok 6\n"; 30print "ok 6\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines