11 plan skip_all => "POSIX is unavailable" if $Config{'extensions'} !~ m!\bPOSIX\b!;
17 use Scalar::Util qw(looks_like_number);
20 _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT
21 _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF _PC_VDISABLE
25 _SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL
26 _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_PAGESIZE _SC_SAVED_IDS
27 _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION
30 plan tests => 2 * 3 * @path_consts + 3 * @sys_consts;
36 my $fd = POSIX::open(File::Spec->curdir, O_RDONLY)
37 or skip "can't open current directory", 3 * @path_consts;
39 for my $constant (@path_consts) {
40 $r = eval { pathconf( File::Spec->curdir, eval "$constant()" ) };
41 is( $@, '', "calling pathconf($constant)" );
42 ok( defined $r, "\tchecking that the returned value is defined: $r" );
43 ok( looks_like_number($r), "\tchecking that the returned value looks like a number" );
48 for my $constant (@path_consts) {
49 $r = eval { pathconf( File::Spec->rootdir, eval "$constant()" ) };
50 is( $@, '', "calling pathconf($constant)" );
51 ok( defined $r, "\tchecking that the returned value is defined: $r" );
52 ok( looks_like_number($r), "\tchecking that the returned value looks like a number" );
56 for my $constant (@sys_consts) {
57 $r = eval { sysconf( eval "$constant()" ) };
58 is( $@, '', "calling sysconf($constant)" );
59 ok( defined $r, "\tchecking that the returned value is defined: $r" );
60 ok( looks_like_number($r), "\tchecking that the returned value looks like a number" );