blib/lib/Affix/Platform/Cygwin.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 53 CC 6 SCAR 32.6
CC
6
Cov
0%
find_library
42.0
BEGIN
2.0
BEGIN
2.0
CRAP 26.0
1 package Affix::Platform::Cygwin v1.3.0 {
2 use v5.40;
3 use DynaLoader;
4 use parent 'Affix::Platform::Unix';
5 use parent 'Exporter';
6 our @EXPORT_OK = qw[find_library];
7 our %EXPORT_TAGS = ( all => \@EXPORT_OK );
8  
9 sub find_library ( $name, $version //= () ) {
10 return $name if -f $name;
11 my $base = $name;
12 $base =~ s[^lib][];
13 return 'cygwin1.dll' if $base eq 'c' || $base eq 'm';
14 for my $file ( "cyg$base.dll", "lib$base.dll", "$base.dll" ) {
15 my $path = DynaLoader::dl_findfile($file);
16 return $path if $path;
17 for my $dir (qw[/usr/bin /usr/lib /bin]) {
18 my $cand = "$dir/$file";
19 return $cand if -f $cand;
20 }
21 }
22 my $path = DynaLoader::dl_findfile("-l$base");
23 return $path if $path;
24 return Affix::Platform::Unix::find_library( $name, $version );
25 }
26 };
27 1;