[perl #32717] BeOS specific Updates
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / Liblist.t
CommitLineData
479d2113 1#!/usr/bin/perl -w
2
3BEGIN {
4 if( $ENV{PERL_CORE} ) {
5 chdir 't' if -d 't';
6 unshift @INC, '../lib';
2799c206 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 }
479d2113 12 }
13 else {
14 unshift @INC, 't/lib';
15 }
16}
17chdir 't';
18
19use strict;
20use Test::More tests => 6;
21use Data::Dumper;
22
23BEGIN {
24 use_ok( 'ExtUtils::Liblist' );
25}
26
27ok( 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
c2990482 34 my $ll = bless {}, 'ExtUtils::Liblist';
35 my @out = $ll->ext('-ln0tt43r3_perl');
479d2113 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}