ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/t/06_group.t
Revision: 1.3
Committed: Sun Oct 22 10:33:19 2006 UTC (17 years, 8 months ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.2: +7 -3 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #!/usr/bin/perl
2    
3     use IO::AIO;
4    
5     print "1..10\n";
6    
7 root 1.2 my $grp = aio_group sub {
8 root 1.3 print $_[0] == 1 && @_ == 3 ? "" : "not ", "ok 4\n";
9 root 1.1 };
10    
11 root 1.3 $grp->result (1,2,3);
12    
13 root 1.1 my ($a, $b) =
14     add $grp (aio_stat "/2", sub { print "ok 3\n" }),
15     (aio_stat "/3", sub { print "not ok 3\n" });
16    
17     print "ok 1\n";
18    
19     $b->cancel;
20    
21     print "ok 2\n";
22    
23     IO::AIO::poll while IO::AIO::nreqs;
24    
25     print "ok 5\n";
26    
27 root 1.2 $grp = aio_group sub {
28 root 1.3 print @_ == 0 ? "" : "not ", "ok 6\n";
29 root 1.1 };
30    
31 root 1.3 $grp->result (4,5,6);
32     $grp->result;
33    
34 root 1.1 add $grp aio_stat "/1", sub { print "not ok 7\n" };
35    
36     $grp->cancel;
37    
38     print "ok 6\n";
39    
40     IO::AIO::poll while IO::AIO::nreqs;
41    
42 root 1.2 aio_group sub {
43 root 1.1 print "ok 8\n";
44     };
45    
46     print "ok 7\n";
47    
48     IO::AIO::poll while IO::AIO::nreqs;
49    
50     IO::AIO::aio_sleep 0, sub { print "ok 9\n" };
51    
52     IO::AIO::poll while IO::AIO::nreqs;
53    
54     print "ok 10\n";