ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/t/02_once.t
Revision: 1.5
Committed: Wed Dec 5 13:59:57 2007 UTC (16 years, 6 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-2_01, rel-2_0, rel-1_71, rel-3_1, rel-3_0, rel-1_85, rel-1_8, rel-1_72, rel-1_6, rel-1_81, rel-1_86
Changes since 1.4: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

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