| 1 |
root |
1.1 |
#!/usr/bin/perl |
| 2 |
|
|
|
| 3 |
|
|
use Test; |
| 4 |
|
|
use IO::AIO; |
| 5 |
|
|
|
| 6 |
|
|
# this is a lame test, but.... |
| 7 |
|
|
|
| 8 |
root |
1.5 |
BEGIN { plan tests => 10 } |
| 9 |
root |
1.1 |
|
| 10 |
|
|
IO::AIO::min_parallel 2; |
| 11 |
|
|
|
| 12 |
root |
1.5 |
IO::AIO::aio_nop sub { |
| 13 |
root |
1.3 |
print "ok 6\n"; |
| 14 |
|
|
}; |
| 15 |
|
|
|
| 16 |
root |
1.5 |
IO::AIO::aio_busy 0.2, sub { |
| 17 |
|
|
print "ok 8\n"; |
| 18 |
|
|
|
| 19 |
|
|
}; |
| 20 |
|
|
|
| 21 |
root |
1.1 |
print "ok 1\n"; |
| 22 |
|
|
|
| 23 |
|
|
if (open FH, "-|") { |
| 24 |
|
|
print while <FH>; |
| 25 |
|
|
aio_stat "/", sub { |
| 26 |
root |
1.3 |
print "ok 7\n"; |
| 27 |
root |
1.1 |
}; |
| 28 |
root |
1.2 |
print "ok 5\n"; |
| 29 |
root |
1.4 |
IO::AIO::poll while IO::AIO::nreqs; |
| 30 |
root |
1.5 |
print "ok 9\n"; |
| 31 |
root |
1.1 |
} else { |
| 32 |
root |
1.2 |
print "ok 2\n"; |
| 33 |
root |
1.1 |
aio_stat "/", sub { |
| 34 |
root |
1.2 |
print "ok 3\n"; |
| 35 |
root |
1.1 |
}; |
| 36 |
root |
1.4 |
IO::AIO::poll while IO::AIO::nreqs; |
| 37 |
root |
1.2 |
print "ok 4\n"; |
| 38 |
root |
1.1 |
exit; |
| 39 |
|
|
} |
| 40 |
|
|
|
| 41 |
root |
1.5 |
print "ok 10\n"; |
| 42 |
root |
1.1 |
|