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; 16use Data::Dumper; 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 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 Dumper @warn; 36} 37