X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftaint.t;fp=t%2Ftaint.t;h=ef527de50d147b692b36157185bd365f7156f489;hb=dcddf99e50e8b4d958156109c299afefd3418068;hp=8ca13461f30e719bafb801e5860e539c71722478;hpb=4d270a2edf18a2df485db24100fb544a469f3b45;p=p5sagit%2FModule-Metadata.git diff --git a/t/taint.t b/t/taint.t index 8ca1346..ef527de 100644 --- a/t/taint.t +++ b/t/taint.t @@ -3,9 +3,19 @@ use strict; use warnings; use 5.008000; # for ${^TAINT} +use Test::More tests => 2; use Module::Metadata; -use Test::More; -use Test::Fatal; +use Carp 'croak'; + +# stolen liberally from Class-Tiny/t/lib/TestUtils.pm - thanks xdg! +sub exception(&) { + my $code = shift; + my $success = eval { $code->(); 1 }; + my $err = $@; + return undef if $success; # original returned '' + croak "Execution died, but the error was lost" unless $@; + return $@; +} ok(${^TAINT}, 'taint flag is set'); @@ -17,4 +27,3 @@ is( 'no exception', ); -done_testing;