[perl #32717] BeOS specific Updates
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / Liblist.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     if( $ENV{PERL_CORE} ) {
5         chdir 't' if -d 't';
6         unshift @INC, '../lib';
7         require Config; import Config;
8         if ($Config{'extensions'} !~ /\bData\/Dumper\b/) {
9             print "1..0 # Skip: Data::Dumper was not built\n";
10                 exit 0;
11         }
12     }
13     else {
14         unshift @INC, 't/lib';
15     }
16 }
17 chdir 't';
18
19 use strict;
20 use Test::More tests => 6;
21 use Data::Dumper;
22
23 BEGIN {
24     use_ok( 'ExtUtils::Liblist' );
25 }
26
27 ok( defined &ExtUtils::Liblist::ext, 
28     'ExtUtils::Liblist::ext() defined for backwards compat' );
29
30 {
31     my @warn;
32     local $SIG{__WARN__} = sub {push @warn, [@_]};
33
34     my $ll = bless {}, 'ExtUtils::Liblist';
35     my @out = $ll->ext('-ln0tt43r3_perl');
36     is( @out, 4, 'enough output' );
37     unlike( $out[2], qr/-ln0tt43r3_perl/, 'bogus library not added' );
38     ok( @warn, 'had warning');
39
40     is( grep(/\QNote (probably harmless): No library found for \E(-l)?n0tt43r3_perl/, map { @$_ } @warn), 1 ) || diag Dumper @warn;
41 }