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.1 by root, Fri Nov 23 12:22:26 2007 UTC vs.
Revision 1.11 by root, Thu Oct 21 15:13:42 2010 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..8\n"; } 8BEGIN { $| = 1; print "1..30\n"; }
2 9
3no warnings; 10no warnings;
4use strict; 11use strict;
12use Socket;
5 13
6use EV; 14use EV;
7 15
16for my $it ("", 1, 2) {
8for my $i (2..5) { 17 for my $i (3..5) {
9 EV::once undef, 0, $i * 0.05, sub { 18 EV::once undef, 0, ($i - 3) * 0.1 + 0.2, sub {
10 print $_[0] == EV::TIMEOUT ? "" : "not ", "ok $i\n"; 19 print $_[0] == EV::TIMEOUT ? "" : "not ", "ok $it$i\n";
20 };
21 }
22
23 socketpair my $s1, my $s2, AF_UNIX, SOCK_STREAM, PF_UNSPEC;
24
25 EV::once $s1, EV::WRITE, 0.1, sub {
26 print $_[0] & EV::WRITE ? "" : "not ", "ok ${it}2\n";
11 }; 27 };
28
29 print "ok ${it}1\n";
30 EV::run;
31 print "ok ${it}6\n";
32 EV::signal INT => sub { };
33 print "ok ${it}7\n";
34 EV::async sub { };
35 print "ok ${it}8\n";
36 EV::default_destroy;
37 print "ok ${it}9\n";
38 EV::default_loop;
39 print "ok ", ${it}*10 + 10, "\n";
12} 40}
13 41
14print "ok 1\n";
15EV::loop;
16print "ok 6\n";
17
18EV::once 1, EV::WRITE, 0.5, sub {
19 print $_[0] == EV::WRITE ? "" : "not ", "ok 7\n";
20};
21
22EV::loop;
23print "ok 8\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines