Path-ScanINC

 view release on metacpan or  search on metacpan

t/lib/winfail.pm  view on Meta::CPAN

use Test::More;
use Test::Fatal;

my $last;
my $will_reason;
my $expect_undef;

sub will_win($)  { $will_reason = $_[0]; $expect_undef = 1 }
sub will_fail($) { $will_reason = $_[0]; $expect_undef = undef }

sub t(&) {
  my $result = &exception( $_[0] );
  if ( $ENV{TRACE_EXCEPTIONS} ) {
    note $result if defined $result;
  }
  if ($expect_undef) {
    if ( not defined $result ) {
      return pass "[no exception] $will_reason";
    }
    else {
      return fail "$will_reason (expected nonfatal)";



( run in 0.218 second using v1.01-cache-2.11-cpan-49f99fa48dc )