[This adds a new test file.]

The change in Makemaker made Liblist unusable (again!) if not called
from MakeMaker.pm.  This breaks all the modules which decide at build
time which functionality to use basing on the present libraries.

Sigh,
Ilya

P.S.  On one of the patches of today I did not put Cc
      [EMAIL PROTECTED]  Sorry.

--- ./MANIFEST-pre      Sat Nov  9 15:08:10 2002
+++ ./MANIFEST  Wed Dec 11 12:16:12 2002
@@ -1094,6 +1094,7 @@ lib/ExtUtils/t/MM_OS2.t           See if ExtUtils
 lib/ExtUtils/t/MM_Unix.t       See if ExtUtils::MM_UNIX works
 lib/ExtUtils/t/MM_VMS.t                See if ExtUtils::MM_VMS works
 lib/ExtUtils/t/MM_Win32.t      See if ExtUtils::MM_Win32 works
+lib/ExtUtils/t/Liblist.t       See if ExtUtils::Liblist works
 lib/ExtUtils/t/Packlist.t      See if Packlist works
 lib/ExtUtils/t/prefixify.t     See if MakeMaker can apply a PREFIX
 lib/ExtUtils/t/problems.t      How MakeMaker reacts to build problems
--- ./lib/ExtUtils/Liblist.pm-pre       Fri Jul 19 16:49:46 2002
+++ ./lib/ExtUtils/Liblist.pm   Wed Dec 11 12:10:20 2002
@@ -11,8 +11,9 @@ sub lsdir {
   shift;
   my $rex = qr/$_[1]/;
   opendir DIR, $_[0];
-  grep /$rex/, readdir DIR;
+  my @out = grep /$rex/, readdir DIR;
   closedir DIR;
+  @out;
 }
 
 __END__
--- ./lib/ExtUtils/t/Liblist.t-pre      Wed Dec 11 12:09:32 2002
+++ ./lib/ExtUtils/t/Liblist.t  Wed Dec 11 12:15:04 2002
@@ -0,0 +1,33 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        unshift @INC, '../lib';
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+chdir 't';
+
+use strict;
+
+# these files help the test run
+use Test::More tests => 5;
+
+# use module
+BEGIN { 
+    use_ok( 'ExtUtils::Liblist' ); 
+}
+
+my @warn;
+$SIG{__WARN__} = sub {push @warn, [@_]};
+
+my @out = ExtUtils::Liblist->ext('-ln0tt43r3_perl');
+is( scalar @out, 4, 'enough output' );
+unlike( $out[2], qr/-ln0tt43r3_perl/, 'no non-existing library' );
+is(scalar @warn, 1, 'had warning');
+like($warn[0][0],
+     qr/\QNote (probably harmless): No library found for -ln0tt43r3_perl/,
+     'expected warning');

Reply via email to