… | |
… | |
3 | use Test; |
3 | use Test; |
4 | use IO::AIO; |
4 | use IO::AIO; |
5 | |
5 | |
6 | # this is a lame test, but.... |
6 | # this is a lame test, but.... |
7 | |
7 | |
8 | BEGIN { plan tests => 9 } |
8 | BEGIN { plan tests => 8 } |
9 | |
9 | |
10 | IO::AIO::min_parallel 2; |
10 | IO::AIO::min_parallel 2; |
11 | |
11 | |
12 | print "ok 1\n"; |
12 | print "ok 1\n"; |
13 | |
13 | |
14 | aio_stat "/", sub { |
|
|
15 | print "ok 2\n"; # pre-fork |
|
|
16 | }; |
|
|
17 | |
|
|
18 | if (open FH, "-|") { |
14 | if (open FH, "-|") { |
19 | print while <FH>; |
15 | print while <FH>; |
20 | aio_stat "/", sub { |
16 | aio_stat "/", sub { |
21 | print "ok 7\n"; |
17 | print "ok 6\n"; |
22 | }; |
18 | }; |
23 | print "ok 6\n"; |
19 | print "ok 5\n"; |
24 | IO::AIO::poll; |
20 | IO::AIO::poll; |
25 | print "ok 8\n"; |
21 | print "ok 7\n"; |
26 | } else { |
22 | } else { |
27 | print "ok 3\n"; |
23 | print "ok 2\n"; |
28 | aio_stat "/", sub { |
24 | aio_stat "/", sub { |
29 | print "ok 4\n"; |
25 | print "ok 3\n"; |
30 | }; |
26 | }; |
31 | IO::AIO::poll; |
27 | IO::AIO::poll; |
32 | print "ok 5\n"; |
28 | print "ok 4\n"; |
33 | exit; |
29 | exit; |
34 | } |
30 | } |
35 | |
31 | |
36 | print "ok 9\n"; |
32 | print "ok 8\n"; |
37 | |
33 | |