Skip to content

Commit

Permalink
Add basic EVAL :check testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed May 21, 2019
1 parent 9e16f33 commit df48391
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion S29-context/eval.t
Expand Up @@ -3,7 +3,7 @@ use nqp;
use Test;
use lib $?FILE.IO.parent(2).add("packages/Test-Helpers");
use Test::Util;
plan 25;
plan 27;

# L<S29/Context/"=item EVAL">

Expand Down Expand Up @@ -116,4 +116,13 @@ is('$rt115344'.EVAL, $rt115344, 'method form of EVAL sees outer lexicals');
is_run 'use MONKEY-SEE-NO-EVAL; EVAL q|print "I ® U"|.encode',
{:out('I ® U'), :err(''), :0status}, 'EVAL(Buf)';

# :check parameter on EVAL
{
my $compile-time = False;
my $run-time = False;
EVAL q/BEGIN $compile-time = True; $run-time = True/, :check;
ok $compile-time, 'Did the EVAL run compile time actions';
nok $run-time, 'Did the EVAL NOT run the code';
}

# vim: ft=perl6

0 comments on commit df48391

Please sign in to comment.