Because we chdir to 'Big-Dummy' the lib/utf8.pm may be at
[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 use Data::Dumper;
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 @out = ExtUtils::Liblist->ext('-ln0tt43r3_perl');
30     is( @out, 4, 'enough output' );
31     unlike( $out[2], qr/-ln0tt43r3_perl/, 'bogus library not added' );
32     ok( @warn, 'had warning');
33
34     is( grep(/\QNote (probably harmless): No library found for \E(-l)?n0tt43r3_perl/, map { @$_ } @warn), 1 ) || diag Dumper @warn;
35 }