1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
# test
use strict ;
use warnings ;
use Data::TreeDumper ;
use Test::Exception ;
use Test::Warn;
#~ use Test::NoWarnings qw(had_no_warnings);
use Test::More 'no_plan';
use Test::Block qw($Plan);
use Eval::Context ;
{
local $Plan = {'No NoWarnings' => 2} ;
# the Test::NoWarnings module makes the following test segfault!! Test without that module
my $context = new Eval::Context() ;
lives_ok
{
my $value = $context->eval(CODE => "(7,8) ;", PACKAGE => 'A') ;
is($value, 8, 'eval returned last value') or diag "latest code:\n$context->{LATEST_CODE}\n" ;
} 'returned list, scalar context' ;
}
|