1#!/usr/bin/perl -w 2 3use lib 't/lib'; 4chdir 't'; 5 6use strict; 7use Test::More tests => 6; 8 9 10BEGIN { 11 use_ok( 'ExtUtils::Liblist' ); 12} 13 14ok( defined &ExtUtils::Liblist::ext, 15 'ExtUtils::Liblist::ext() defined for backwards compat' ); 16 17{ 18 my @warn; 19 local $SIG{__WARN__} = sub {push @warn, [@_]}; 20 21 my $ll = bless {}, 'ExtUtils::Liblist'; 22 my @out = $ll->ext('-ln0tt43r3_perl'); 23 is( @out, 4, 'enough output' ); 24 unlike( $out[2], qr/-ln0tt43r3_perl/, 'bogus library not added' ); 25 ok( @warn, 'had warning'); 26 27 is( grep(/\QNote (probably harmless): No library found for \E(-l)?n0tt43r3_perl/, map { @$_ } @warn), 1 ) || diag join "\n", @warn; 28} 29