7 use Test::More tests => 19;
11 my $cwd = Cwd::sys_cwd();
14 my $lpb = Cwd::extLibpath;
15 $lpb .= ';' unless $lpb and $lpb =~ /;$/;
17 my $lpe = Cwd::extLibpath(1);
18 $lpe .= ';' unless $lpe and $lpe =~ /;$/;
20 ok Cwd::extLibpath_set("$lpb$cwd");
22 $lpb = Cwd::extLibpath;
24 (my $s_cwd = $cwd) =~ s#\\#/#g;
26 like($lpb, qr/\Q$s_cwd/);
28 ok Cwd::extLibpath_set("$lpe$cwd", 1);
30 $lpe = Cwd::extLibpath(1);
33 like($lpe, qr/\Q$s_cwd/);
35 if (uc OS2::DLLname() eq uc $^X) { # Static build
36 my ($short) = ($^X =~ m,.*[/\\]([^.]+),);
37 is(uc OS2::DLLname(1), uc $short);
38 is(uc OS2::DLLname, uc $^X ); # automatically
39 is(1,1); # automatically...
41 is(uc OS2::DLLname(1), uc $Config{dll_name});
42 like(OS2::DLLname, qr#\Q/$Config{dll_name}\E\.dll$#i );
43 (my $root_cwd = $s_cwd) =~ s,/t$,,;
44 like(OS2::DLLname, qr#^\Q$root_cwd\E(/t)?\Q/$Config{dll_name}\E\.dll#i );
46 is(OS2::DLLname, OS2::DLLname(2));
47 like(OS2::DLLname(0), qr#^(\d+)$# );
50 is(OS2::DLLname($_), OS2::DLLname($_, \&Cwd::extLibpath) ) for 0..2;
51 ok(not defined eval { OS2::DLLname $_, \&Cwd::cwd; 1 } ) for 0..2;
52 ok(not defined eval { OS2::DLLname $_, \&xxx; 1 } ) for 0..2;