Fix a2p manpage (from Debian)
[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     }
8     else {
9         unshift @INC, 't/lib';
10     }
11 }
12 chdir 't';
13
14 use strict;
15 use Test::More tests => 6;
16
17
18 BEGIN {
19     use_ok( 'ExtUtils::Liblist' );
20 }
21
22 ok( defined &ExtUtils::Liblist::ext, 
23     'ExtUtils::Liblist::ext() defined for backwards compat' );
24
25 {
26     my @warn;
27     local $SIG{__WARN__} = sub {push @warn, [@_]};
28
29     my $ll = bless {}, 'ExtUtils::Liblist';
30     my @out = $ll->ext('-ln0tt43r3_perl');
31     is( @out, 4, 'enough output' );
32     unlike( $out[2], qr/-ln0tt43r3_perl/, 'bogus library not added' );
33     ok( @warn, 'had warning');
34
35     is( grep(/\QNote (probably harmless): No library found for \E(-l)?n0tt43r3_perl/, map { @$_ } @warn), 1 ) || diag join "\n", @warn;
36 }