File: 04_fork.t

package info (click to toggle)
libio-aio-perl 2.4-1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 356 kB
  • ctags: 76
  • sloc: perl: 413; ansic: 97; makefile: 50
file content (37 lines) | stat: -rw-r--r-- 516 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/perl

use Test;
use IO::AIO;

# this is a lame test, but....

BEGIN { plan tests => 9 }

IO::AIO::min_parallel 2;

aio_nop sub {
   print "ok 6\n";
};

print "ok 1\n";

if (open FH, "-|") {
   print while <FH>;
   aio_stat "/", sub {
      print "ok 7\n";
   };
   print "ok 5\n";
   IO::AIO::poll while IO::AIO::nreqs;
   print "ok 8\n";
} else {
   print "ok 2\n";
   aio_stat "/", sub {
      print "ok 3\n";
   };
   IO::AIO::poll while IO::AIO::nreqs;
   print "ok 4\n";
   exit;
}

print "ok 9\n";