ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/t/02_once.t
Revision: 1.8
Committed: Fri Nov 21 02:23:15 2008 UTC (15 years, 7 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-3_51, rel-3_53, rel-3_52
Changes since 1.7: +7 -0 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 BEGIN {
2 if (exists $ENV{AUTOMATED_TESTING}) {
3 print "1..0 # Skipped: Too many broken cpan tester setups.\n";
4 exit;
5 }
6 }
7
8 BEGIN { $| = 1; print "1..6\n"; }
9
10 no warnings;
11 use strict;
12 use Socket;
13
14 use EV;
15
16 for my $i (3..5) {
17 EV::once undef, 0, ($i - 3) * 0.5 + 1.0, sub {
18 print $_[0] == EV::TIMEOUT ? "" : "not ", "ok $i\n";
19 };
20 }
21
22 socketpair my $s1, my $s2, AF_UNIX, SOCK_STREAM, PF_UNSPEC;
23
24 EV::once $s1, EV::WRITE, 0.5, sub {
25 print $_[0] & EV::WRITE ? "" : "not ", "ok 2\n";
26 };
27
28 print "ok 1\n";
29 EV::loop;
30 print "ok 6\n";