|
#!/usr/bin/perl -T
use Test::More $Config {ccflags} =~ /-DSILENT_NO_TAINT_SUPPORT/ ? ( skip_all => 'No taint support' ) : ( tests => 2 );
sub exception(&) {
my $code = shift ;
my $success = eval { $code ->(); 1 };
my $err = $@;
return undef if $success ;
croak "Execution died, but the error was lost" unless $@;
return $@;
}
my $taint_on = ! eval { no warnings; join ( '' , values %ENV ), kill 0; 1; };
ok( $taint_on , 'taint flag is set' );
is(
exception { Module::Metadata->new_from_module( "Module::Metadata" )->version },
undef ,
'no exception' ,
);
|