Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test that p5 subs in void context return Nil
  • Loading branch information
pmurias committed Oct 16, 2011
1 parent 73302b8 commit a97d866
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions S01-perl-5-integration/context.t
Expand Up @@ -8,6 +8,7 @@ my &p5_void := eval(
$::got_void = 1;
}
}',:lang<perl5>);

p5_void(:context<void>);
is(eval(:lang<perl5>,'$::got_void'),1,":contex<void> sets void context");
p5_void(:context<scalar>);
Expand Down Expand Up @@ -46,6 +47,10 @@ p5_list(:context<scalar>);
is(eval(:lang<perl5>,'$::got_list'),0,":contex<scalar> dosn't set list context");
p5_list(:context<void>);
is(eval(:lang<perl5>,'$::got_list'),0,":contex<void> dosn't sets list context");

my &p5_list_of_values := eval('sub {return (1,2,3,4)}',:lang<perl5>);
ok(p5_list_of_values(:context<void>) ~~ Nil,"a p5 sub called in void context returns a Nil");

done;

# vim: ft=perl6

0 comments on commit a97d866

Please sign in to comment.