ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/t/06_group.t
(Generate patch)

Comparing IO-AIO/t/06_group.t (file contents):
Revision 1.1 by root, Sun Oct 22 00:19:05 2006 UTC vs.
Revision 1.5 by root, Mon Oct 23 20:05:27 2006 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines