ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/t/06_loop_once.t
Revision: 1.2
Committed: Wed Nov 19 10:16:39 2008 UTC (15 years, 7 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-3_49
Changes since 1.1: +1 -1 lines
Log Message:
bleh desu

File Contents

# User Rev Content
1 root 1.1 BEGIN { $| = 1; print "1..6\n"; }
2    
3     no warnings;
4     use strict;
5     use Socket;
6    
7     use EV;
8    
9     my $l = new EV::Loop;
10    
11     for my $i (3..5) {
12 root 1.2 $l->once (undef, 0, ($i - 3) * 0.5 + 1.0, sub {
13 root 1.1 print $_[0] == EV::TIMEOUT ? "" : "not ", "ok $i\n";
14     });
15     }
16    
17     socketpair my $s1, my $s2, AF_UNIX, SOCK_STREAM, PF_UNSPEC;
18    
19     $l->once ($s1, EV::WRITE, 0.5, sub {
20     print $_[0] & EV::WRITE ? "" : "not ", "ok 2\n";
21     });
22    
23     print "ok 1\n";
24     $l->loop;
25     print "ok 6\n";