File: 005_eval_no_NoWarnings.t

package info (click to toggle)
libeval-context-perl 0.09.11-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 292 kB
  • ctags: 23
  • sloc: perl: 762; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 605 bytes parent folder | download | duplicates (6)
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' ;
}