- Timestamp:
- 10/01/08 09:53:20 (2 months ago)
- Files:
-
- 1 modified
-
t/spec/S29-context/eval.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
t/spec/S29-context/eval.t
r21417 r22471 11 11 =end pod 12 12 13 #?rakudo skip "Null PMC access in find_method()" 14 15 #?rakudo emit =begin unimpl 16 13 17 # eval should evaluate the code in the lexical scope of eval's caller 14 18 sub make_eval_closure { my $a = 5; sub ($s) { eval $s } }; 15 19 is(make_eval_closure()('$a'), 5, 'eval runs code in the proper lexical scope'); 16 20 21 #?rakudo emit =end unimpl 22 17 23 is(eval('5'), 5, 'simple eval works and returns the value'); 18 24 my $foo = 1234; 25 #?rakudo skip "unimpl Null PMC access in find_method" 19 26 is(eval('$foo'), $foo, 'simple eval using variable defined outside'); 20 27 21 28 # traps die? 29 #?rakudo skip "unimpl Null PMC access in type()" 22 30 ok(!eval('die; 1'), "eval can trap die"); 23 31 24 32 ok(!eval('my @a = (1); @a<0>'), "eval returns undef on syntax error"); 25 33 34 #?rakudo skip "unimpl Null PMC access in type()" 26 35 ok(!eval('use Poison; 1'), "eval can trap a fatal use statement"); 27 36 … … 32 41 33 42 # L<S04/Exception handlers/Perl 6's eval function only evaluates strings, not blocks.> 43 #?rakudo skip "unimpl Null PMC access in find_method" 34 44 dies_ok({eval {42}}, 'block eval is gone');
