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