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.10 by root, Sun Jul 19 03:49:04 2009 UTC vs.
Revision 1.12 by root, Thu Oct 28 04:59:35 2010 UTC

14use EV; 14use EV;
15 15
16for my $it ("", 1, 2) { 16for my $it ("", 1, 2) {
17 for my $i (3..5) { 17 for my $i (3..5) {
18 EV::once undef, 0, ($i - 3) * 0.1 + 0.2, sub { 18 EV::once undef, 0, ($i - 3) * 0.1 + 0.2, sub {
19 print $_[0] == EV::TIMEOUT ? "" : "not ", "ok $it$i\n"; 19 print $_[0] == EV::TIMER ? "" : "not ", "ok $it$i\n";
20 }; 20 };
21 } 21 }
22 22
23 socketpair my $s1, my $s2, AF_UNIX, SOCK_STREAM, PF_UNSPEC; 23 socketpair my $s1, my $s2, AF_UNIX, SOCK_STREAM, PF_UNSPEC;
24 24
25 EV::once $s1, EV::WRITE, 0.1, sub { 25 EV::once $s1, EV::WRITE, 0.1, sub {
26 print $_[0] & EV::WRITE ? "" : "not ", "ok ${it}2\n"; 26 print $_[0] & EV::WRITE ? "" : "not ", "ok ${it}2\n";
27 }; 27 };
28 28
29 print "ok ${it}1\n"; 29 print "ok ${it}1\n";
30 EV::loop; 30 EV::run;
31 print "ok ${it}6\n"; 31 print "ok ${it}6\n";
32 EV::signal INT => sub { }; 32 EV::signal INT => sub { };
33 print "ok ${it}7\n"; 33 print "ok ${it}7\n";
34 EV::async sub { }; 34 EV::async sub { };
35 print "ok ${it}8\n"; 35 print "ok ${it}8\n";
36 EV::default_destroy; 36 EV::default_destroy;
37 print "ok ${it}9\n"; 37 print "ok ${it}9\n";
38 EV::default_loop; 38 EV::default_loop;
39 print "ok ", ${it}*10 + 10, "\n"; 39 print "ok ", ${it}*10 + 10, "\n";
40} 40}
41

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines