|
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 User : jackjohn ( 502) PHP Version : 5.3.17 Disable Function : NONE Directory : /installd/perl588installer/perl-5.8.8/os2/ |
Upload File : |
#!/usr/bin/perl -w
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
}
use Test::More tests => 19;
use strict;
use Config;
my $cwd = Cwd::sys_cwd();
ok -d $cwd;
my $lpb = Cwd::extLibpath;
$lpb .= ';' unless $lpb and $lpb =~ /;$/;
my $lpe = Cwd::extLibpath(1);
$lpe .= ';' unless $lpe and $lpe =~ /;$/;
ok Cwd::extLibpath_set("$lpb$cwd");
$lpb = Cwd::extLibpath;
$lpb =~ s#\\#/#g;
(my $s_cwd = $cwd) =~ s#\\#/#g;
like($lpb, qr/\Q$s_cwd/);
ok Cwd::extLibpath_set("$lpe$cwd", 1);
$lpe = Cwd::extLibpath(1);
$lpe =~ s#\\#/#g;
like($lpe, qr/\Q$s_cwd/);
if (uc OS2::DLLname() eq uc $^X) { # Static build
my ($short) = ($^X =~ m,.*[/\\]([^.]+),);
is(uc OS2::DLLname(1), uc $short);
is(uc OS2::DLLname, uc $^X ); # automatically
is(1,1); # automatically...
} else {
is(uc OS2::DLLname(1), uc $Config{dll_name});
like(OS2::DLLname, qr#\Q/$Config{dll_name}\E\.dll$#i );
(my $root_cwd = $s_cwd) =~ s,/t$,,;
like(OS2::DLLname, qr#^\Q$root_cwd\E(/t)?\Q/$Config{dll_name}\E\.dll#i );
}
is(OS2::DLLname, OS2::DLLname(2));
like(OS2::DLLname(0), qr#^(\d+)$# );
is(OS2::DLLname($_), OS2::DLLname($_, \&Cwd::extLibpath) ) for 0..2;
ok(not defined eval { OS2::DLLname $_, \&Cwd::cwd; 1 } ) for 0..2;
ok(not defined eval { OS2::DLLname $_, \&xxx; 1 } ) for 0..2;