hv_fetchs() support
[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';
7 }
8 else {
9 unshift @INC, 't/lib';
10 }
11}
12chdir 't';
13
14use strict;
15use Test::More tests => 6;
5dca256e 16
479d2113 17
18BEGIN {
19 use_ok( 'ExtUtils::Liblist' );
20}
21
22ok( 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
c2990482 29 my $ll = bless {}, 'ExtUtils::Liblist';
30 my @out = $ll->ext('-ln0tt43r3_perl');
479d2113 31 is( @out, 4, 'enough output' );
32 unlike( $out[2], qr/-ln0tt43r3_perl/, 'bogus library not added' );
33 ok( @warn, 'had warning');
34
5dca256e 35 is( grep(/\QNote (probably harmless): No library found for \E(-l)?n0tt43r3_perl/, map { @$_ } @warn), 1 ) || diag join "\n", @warn;
479d2113 36}