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.3 by root, Tue Nov 27 09:32:32 2007 UTC

1BEGIN { $| = 1; print "1..6\n"; } 1BEGIN { $| = 1; print "1..6\n"; }
2 2
3no warnings; 3no warnings;
4use strict; 4use strict;
5use Socket;
5 6
6use EV; 7use EV;
7 8
8for my $i (3..5) { 9for my $i (3..5) {
9 EV::once undef, 0, $i * 0.05, sub { 10 EV::once undef, 0, $i * 0.05, sub {
10 print $_[0] == EV::TIMEOUT ? "" : "not ", "ok $i\n"; 11 print $_[0] == EV::TIMEOUT ? "" : "not ", "ok $i\n";
11 }; 12 };
12} 13}
13 14
15socketpair my $s1, my $s2, AF_UNIX, SOCK_STREAM, PF_UNSPEC;
16
14EV::once 1, EV::WRITE, 0.5, sub { 17EV::once $s1, EV::WRITE, 0.5, sub {
15 print $_[0] == EV::WRITE ? "" : "not ", "ok 2\n"; 18 print $_[0] == EV::WRITE ? "" : "not ", "ok 2\n";
16}; 19};
17 20
18print "ok 1\n"; 21print "ok 1\n";
19EV::loop; 22EV::loop;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines