BEGIN-Lift

 view release on metacpan or  search on metacpan

t/503-error-died-within-keyword.t  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;

use Test::More;

BEGIN {
    use_ok('BEGIN::Lift');

    BEGIN::Lift::install(
        ('main', 'double') => sub {
            die('Died within (' . (caller(0))[3] . ')');
        }
    );
}

our $EXCEPTION;

BEGIN {
    eval q{
        double(10);
        1;
    } or do {
        $EXCEPTION = "$@";
    };
    like(
        $EXCEPTION,
        qr/Died within \(main\:\:double\)/,
        '... got the error expected'
    );
}

done_testing;

1;



( run in 1.545 second using v1.01-cache-2.11-cpan-ff9377addf4 )